Initial commit
commit
251b607c9a
@ -0,0 +1,33 @@
|
||||
font_size 9
|
||||
|
||||
foreground #ffffff
|
||||
background #1b1d1e
|
||||
background_opacity 0.91
|
||||
cursor #ffffff
|
||||
|
||||
active_tab_foreground #d1d1d1
|
||||
active_tab_background #1b1d1e
|
||||
inactive_tab_foreground #8a8888
|
||||
inactive_tab_background #1b1d1e
|
||||
tab_bar_background none
|
||||
|
||||
active_border_color #4383a1
|
||||
inactive_border_color #2e5a6e
|
||||
bell_border_color #6b5c64
|
||||
|
||||
color0 #1b1d1e
|
||||
color8 #adc7d4
|
||||
color1 #6b5c64
|
||||
color9 #976a82
|
||||
color2 #4c7b91
|
||||
color10 #54a5ca
|
||||
color3 #90b3c5
|
||||
color11 #a5efff
|
||||
color4 #426b82
|
||||
color12 #408fbf
|
||||
color5 #7e95a2
|
||||
color13 #91c6e5
|
||||
color6 #9cc2d6
|
||||
color14 #b2ffff
|
||||
color7 #c6c6c6
|
||||
color15 #ffffff
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,3 @@
|
||||
# nvim
|
||||
|
||||
This is basically a copy of [Davincible](https://github.com/davincible/dotfiles/tree/master/nvim)
|
@ -0,0 +1,19 @@
|
||||
|
||||
; decorator
|
||||
(decorator) @function.decorator
|
||||
((decorator (identifier) @function.decorator)
|
||||
(#vim-match? @function.decorator "^([A-Z])@!.*$"))
|
||||
|
||||
|
||||
; Function/method docstring
|
||||
((function_definition
|
||||
body: (block . (expression_statement (string) @rst)))
|
||||
(#offset! @rst 0 3 0 -3))
|
||||
|
||||
((expression_statement (string) @docstring)
|
||||
(#vim-match? @docstring "^\"\"\".*\"\"\"$"))
|
||||
|
||||
|
||||
; Attribute docstring
|
||||
(((expression_statement (assignment)) . (expression_statement (string) @rst))
|
||||
(#offset! @rst 0 3 0 -3))
|
@ -0,0 +1,22 @@
|
||||
function! neoformat#formatters#tiltfile#enabled() abort
|
||||
return ['buildifier', 'black']
|
||||
endfunction
|
||||
|
||||
function! neoformat#formatters#tiltfile#buildifier() abort
|
||||
return {
|
||||
\ 'exe': 'buildifier',
|
||||
\ 'args': ['-path', expand('%:p')],
|
||||
\ 'stdin': 1,
|
||||
\ 'stderr': 1,
|
||||
\ 'try_node_exe': 1,
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
function! neoformat#formatters#tiltfile#black() abort
|
||||
return {
|
||||
\ 'exe': 'black',
|
||||
\ 'stdin': 1,
|
||||
\ 'stderr': 1,
|
||||
\ 'args': ['-q', '-'],
|
||||
\ }
|
||||
endfunction
|
@ -0,0 +1,20 @@
|
||||
" You probably always want to set this in your vim file
|
||||
set background=dark
|
||||
" let g:colors_name="pywal"
|
||||
|
||||
" By setting our module to nil, we clear lua's cache,
|
||||
" which means the require ahead will *always* occur.
|
||||
"
|
||||
" This isn't strictly required but it can be a useful trick if you are
|
||||
" incrementally editing your config a lot and want to be sure your themes
|
||||
" changes are being picked up without restarting neovim.
|
||||
"
|
||||
" Note if you're working in on your theme and have :Lushify'd the buffer,
|
||||
" your changes will be applied with our without the following line.
|
||||
"
|
||||
" The performance impact of this call can be measured in the hundreds of
|
||||
" *nanoseconds* and such could be considered "production safe".
|
||||
lua package.loaded['lush_theme.pywal'] = nil
|
||||
"
|
||||
" " include our theme file and pass it to lush to apply
|
||||
lua require('lush')(require('themes.pywal'))
|
@ -0,0 +1,2 @@
|
||||
require("uno")
|
||||
-- require("testenv")
|
@ -0,0 +1,31 @@
|
||||
local colors = {
|
||||
blue = "#569cd6",
|
||||
green = "#6a9955",
|
||||
purple = "#c586c0",
|
||||
red = "#d16969",
|
||||
yellow = "#dcdcaa",
|
||||
yellow_orange = "#d7ba7d",
|
||||
orange = "#ce9178",
|
||||
fg = "#b4b4b4",
|
||||
bg = "#252525",
|
||||
gray1 = "#252525",
|
||||
gray2 = "#252525",
|
||||
gray3 = "#252525",
|
||||
}
|
||||
|
||||
return {
|
||||
normal = {
|
||||
a = { fg = colors.fg, bg = colors.blue, gui = "bold" },
|
||||
b = { fg = colors.fg, bg = colors.bg },
|
||||
c = { fg = colors.fg, bg = colors.bg },
|
||||
},
|
||||
insert = { a = { fg = colors.fg, bg = colors.green, gui = "bold" } },
|
||||
visual = { a = { fg = colors.fg, bg = colors.purple, gui = "bold" } },
|
||||
command = { a = { fg = colors.fg, bg = colors.cyan, gui = "bold" } },
|
||||
replace = { a = { fg = colors.fg, bg = colors.red, gui = "bold" } },
|
||||
inactive = {
|
||||
a = { fg = colors.gray1, bg = colors.bg, gui = "bold" },
|
||||
b = { fg = colors.gray1, bg = colors.bg },
|
||||
c = { fg = colors.gray1, bg = colors.bg },
|
||||
},
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
-- Copyright (c) 2020-2021 shadmansaleh
|
||||
-- MIT license, see LICENSE for more details.
|
||||
-- Credit: Zoltan Dalmadi(lightline)
|
||||
-- LuaFormatter off
|
||||
local colors = {
|
||||
blue = "#61afef",
|
||||
green = "#98c379",
|
||||
purple = "#c678dd",
|
||||
red1 = "#e06c75",
|
||||
red2 = "#be5046",
|
||||
yellow = "#e5c07b",
|
||||
orange = "#D19A66",
|
||||
fg = "#abb2bf",
|
||||
bg = "#282c34",
|
||||
gray1 = "#5c6370",
|
||||
gray2 = "#2c323d",
|
||||
gray3 = "#3e4452",
|
||||
}
|
||||
-- LuaFormatter on
|
||||
return {
|
||||
normal = {
|
||||
a = { fg = colors.gray2, bg = colors.blue, gui = "bold" },
|
||||
b = { fg = colors.fg, bg = colors.bg },
|
||||
c = { fg = colors.fg, bg = colors.bg },
|
||||
},
|
||||
insert = { a = { fg = colors.gray2, bg = colors.green, gui = "bold" } },
|
||||
visual = { a = { fg = colors.gray2, bg = colors.purple, gui = "bold" } },
|
||||
command = { a = { fg = colors.gray2, bg = colors.yellow, gui = "bold" } },
|
||||
replace = { a = { fg = colors.gray2, bg = colors.red1, gui = "bold" } },
|
||||
inactive = {
|
||||
a = { fg = colors.gray1, bg = colors.bg, gui = "bold" },
|
||||
b = { fg = colors.gray1, bg = colors.bg },
|
||||
c = { fg = colors.gray1, bg = colors.bg },
|
||||
},
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
local id = 0
|
||||
local name = "MyHi_"
|
||||
while true do
|
||||
vim.cmd("hi " .. name .. id .. " guifg=#fff guibg=#ff0000")
|
||||
id = id + 1
|
||||
end
|
@ -0,0 +1,33 @@
|
||||
local colors = {
|
||||
white = "#abb2bf",
|
||||
darker_black = "#1b1f27",
|
||||
black = "#1e222a", -- nvim bg
|
||||
black2 = "#252931",
|
||||
one_bg = "#282c34", -- real bg of onedark
|
||||
one_bg2 = "#353b45",
|
||||
one_bg3 = "#30343c",
|
||||
grey = "#42464e",
|
||||
grey_fg = "#565c64",
|
||||
grey_fg2 = "#6f737b",
|
||||
light_grey = "#6f737b",
|
||||
red = "#d47d85",
|
||||
baby_pink = "#DE8C92",
|
||||
pink = "#ff75a0",
|
||||
line = "#2a2e36", -- for lines like vertsplit
|
||||
green = "#A3BE8C",
|
||||
vibrant_green = "#7eca9c",
|
||||
nord_blue = "#81A1C1",
|
||||
blue = "#61afef",
|
||||
yellow = "#e7c787",
|
||||
sun = "#EBCB8B",
|
||||
purple = "#b4bbc8",
|
||||
dark_purple = "#c882e7",
|
||||
teal = "#519ABA",
|
||||
orange = "#fca2aa",
|
||||
cyan = "#a3b8ef",
|
||||
statusline_bg = "#22262e",
|
||||
lightbg = "#2d3139",
|
||||
lightbg2 = "#262a32",
|
||||
}
|
||||
|
||||
return colors
|
@ -0,0 +1,580 @@
|
||||
--
|
||||
-- Built with,
|
||||
--
|
||||
-- ,gggg,
|
||||
-- d8" "8I ,dPYb,
|
||||
-- 88 ,dP IP'`Yb
|
||||
-- 8888888P" I8 8I
|
||||
-- 88 I8 8'
|
||||
-- 88 gg gg ,g, I8 dPgg,
|
||||
-- ,aa,_88 I8 8I ,8'8, I8dP" "8I
|
||||
-- dP" "88P I8, ,8I ,8' Yb I8P I8
|
||||
-- Yb,_,d88b,,_ ,d8b, ,d8b,,8'_ 8) ,d8 I8,
|
||||
-- "Y8P" "Y888888P'"Y88P"`Y8P' "YY8P8P88P `Y8
|
||||
--
|
||||
|
||||
-- This is a starter colorscheme for use with Lush,
|
||||
-- for usage guides, see :h lush or :LushRunTutorial
|
||||
|
||||
--
|
||||
-- Note: Because this is lua file, vim will append your file to the runtime,
|
||||
-- which means you can require(...) it in other lua code (this is useful),
|
||||
-- but you should also take care not to conflict with other libraries.
|
||||
--
|
||||
--
|
||||
-- (This is a lua quirk, as it has somewhat poor support for namespacing.)
|
||||
--
|
||||
-- Basically, name your file,
|
||||
--
|
||||
-- "super_theme/lua/lush_theme/super_theme_dark.lua",
|
||||
--
|
||||
-- not,
|
||||
--
|
||||
-- "super_theme/lua/dark.lua".
|
||||
--
|
||||
-- With that caveat out of the way...
|
||||
--
|
||||
|
||||
-- Enable lush.ify on this file, run:
|
||||
--
|
||||
-- `:Lushify`
|
||||
--
|
||||
-- or
|
||||
--
|
||||
-- `:lua require('lush').ify()`
|
||||
|
||||
local lush = require("lush")
|
||||
local hsl = lush.hsl
|
||||
|
||||
function getColors()
|
||||
local colorTable = {}
|
||||
local home = os.getenv("HOME")
|
||||
local pywal_colors = home .. "/.cache/wal/colors"
|
||||
file = io.open(pywal_colors, "r")
|
||||
for line in file:lines() do
|
||||
table.insert(colorTable, line)
|
||||
end
|
||||
return colorTable
|
||||
end
|
||||
|
||||
-- Read colors in from pywal cache
|
||||
local colors = getColors()
|
||||
|
||||
local theme = lush(function()
|
||||
local l = 50
|
||||
local s = 18
|
||||
local color1 = hsl(colors[1]).lighten(l).saturate(s)
|
||||
local color2 = hsl(colors[2]).lighten(l).saturate(s)
|
||||
local color3 = hsl(colors[3]).lighten(l).saturate(s)
|
||||
local color4 = hsl(colors[4]).lighten(l).saturate(s)
|
||||
local color5 = hsl(colors[5]).lighten(l).saturate(s)
|
||||
local color6 = hsl(colors[6]).lighten(l).saturate(s)
|
||||
local color7 = hsl(colors[7]).lighten(l).saturate(s)
|
||||
local color8 = hsl(colors[8]).lighten(l).saturate(s)
|
||||
local color9 = hsl(colors[9]).lighten(l).saturate(s)
|
||||
local color10 = hsl(colors[10]).lighten(l).saturate(s)
|
||||
local color11 = hsl(colors[11]).lighten(l).saturate(s)
|
||||
local color12 = hsl(colors[12]).lighten(l).saturate(s)
|
||||
local color13 = hsl(colors[13]).lighten(l).saturate(s)
|
||||
local color14 = hsl(colors[14]).lighten(l).saturate(s)
|
||||
local color15 = hsl(colors[15]).lighten(l).saturate(s)
|
||||
local color16 = hsl(colors[16]).lighten(l).saturate(s)
|
||||
|
||||
-- Onedark theme
|
||||
local white = hsl("#abb2bf")
|
||||
local darker_black = hsl("#1b1f27")
|
||||
local black = hsl("#1e222a") -- nvim bg
|
||||
local black2 = hsl("#252931")
|
||||
local one_bg = hsl("#282c34") -- real bg of onedark
|
||||
local one_bg2 = hsl("#353b45")
|
||||
local one_bg3 = hsl("#30343c")
|
||||
local grey = hsl("#42464e")
|
||||
local grey_fg = hsl("#565c64")
|
||||
local grey_fg2 = hsl("#6f737b")
|
||||
local light_grey = hsl("#6f737b")
|
||||
local red = hsl("#d47d85")
|
||||
local baby_pink = hsl("#DE8C92")
|
||||
local pink = hsl("#ff75a0")
|
||||
local line = hsl("#2a2e36") -- for lines like vertsplit
|
||||
local green = hsl("#A3BE8C")
|
||||
local vibrant_green = hsl("#7eca9c")
|
||||
local nord_blue = hsl("#81A1C1")
|
||||
local blue = hsl("#61afef")
|
||||
local yellow = hsl("#e7c787")
|
||||
local sun = hsl("#EBCB8B")
|
||||
local purple = hsl("#b4bbc8")
|
||||
local dark_purple = hsl("#c882e7")
|
||||
local teal = hsl("#519ABA")
|
||||
local orange = hsl("#fca2aa")
|
||||
local cyan = hsl("#a3b8ef")
|
||||
local statusline_bg = hsl("#22262e")
|
||||
local lightbg = hsl("#2d3139")
|
||||
local lightbg2 = hsl("#262a32")
|
||||
|
||||
return {
|
||||
-- The following are all the Neovim default highlight groups from the docs
|
||||
-- as of 0.5.0-nightly-446, to aid your theme creation. Your themes should
|
||||
-- probably style all of these at a bare minimum.
|
||||
--
|
||||
-- Referenced/linked groups must come before being referenced/lined,
|
||||
-- so the order shown ((mostly) alphabetical) is likely
|
||||
-- not the order you will end up with.
|
||||
--
|
||||
-- You can uncomment these and leave them empty to disable any
|
||||
-- styling for that group (meaning they mostly get styled as Normal)
|
||||
-- or leave them commented to apply vims default colouring or linking.
|
||||
|
||||
Comment({ fg = color11.lighten(60).saturate(40), gui = "italic" }), -- any comment
|
||||
ColorColumn({ bg = color1.darken(20) }), -- used for the columns set with 'colorcolumn'
|
||||
Conceal({ fg = red.darken(20) }), -- placeholder characters substituted for concealed text (see 'conceallevel')
|
||||
Cursor({ fg = color9 }), -- character under the cursor
|
||||
lCursor({ bg = color3.lighten(10), fg = color10.darken(60) }), -- the character under the cursor when |language-mapping| is used (see 'guicursor')
|
||||
CursorIM({ bg = color6, fg = color1 }), -- like Cursor, but used when in IME mode |CursorIM|
|
||||
CursorColumn({ fg = color8 }), -- Screen-column at the cursor, when 'cursorcolumn' is set.
|
||||
CursorLine({ bg = color1.darken(70).saturate(-20), fg = color2.lighten(50).saturate(40) }), -- Screen-line at the cursor, when 'cursorline' is set. Low-priority if foreground (ctermfg OR guifg) is not set.
|
||||
Directory({ fg = color6 }), -- directory names (and other special names in listings)
|
||||
EndOfBuffer({ fg = color2.darken(10) }), -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|.
|
||||
TermCursor({ bg = color6, fg = color1 }), -- cursor in a focused terminal
|
||||
TermCursorNC({ bg = color3, fg = color1 }), -- cursor in an unfocused terminal
|
||||
ErrorMsg({ fg = pink.darken(40).saturate(-20) }), -- error messages on the command line
|
||||
VertSplit({ fg = color2.darken(50) }), -- the column separating vertically split windows
|
||||
Folded({ fg = color3.darken(5) }), -- line used for closed folds
|
||||
FoldColumn({ fg = color3 }), -- 'foldcolumn'
|
||||
SignColumn({ fg = color6 }), -- column where |signs| are displayed
|
||||
Search({ bg = color8.darken(5), fg = black }), -- Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand out.
|
||||
IncSearch({ bg = color8, fg = color1 }), -- 'incsearch' highlighting; also used for the text replaced with ":s///c"
|
||||
Substitute({ bg = color7, fg = color1 }), -- |:substitute| replacement text highlighting
|
||||
LineNr({ fg = color12.darken(40).rotate(-30).saturate(-50) }), -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
|
||||
CursorLineNr({ bg = color12.darken(80), fg = color12.darken(10) }), -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
|
||||
MatchParen({ fg = color1.lighten(50) }), -- The character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt|
|
||||
ModeMsg({ fg = color6 }), -- 'showmode' message (e.g., "-- INSERT -- ")
|
||||
MsgArea({ fg = color6.darken(15) }), -- Area for messages and cmdline
|
||||
MsgSeparator({ bg = color1.darken(80), fg = color5.lighten(60) }), -- Separator for scrolled messages, `msgsep` flag of 'display'
|
||||
MoreMsg({ fg = color6.lighten(10), gui = "italic" }), -- |more-prompt|
|
||||
NonText({ fg = color2.darken(20), ctermbg = none }), -- '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|.
|
||||
Normal({ fg = color1.lighten(50).rotate(50), ctermbg = none }), -- normal text
|
||||
NormalFloat({ fg = Normal.fg }), -- Normal text in floating windows.
|
||||
NormalNC({ fg = color1.lighten(40).rotate(40) }), -- normal text in non-current windows
|
||||
Pmenu({ bg = color2.darken(40).saturate(-40), fg = color8 }), -- Popup menu: normal item.
|
||||
PmenuSel({ bg = color5.lighten(20), fg = color3.darken(60) }), -- Popup menu: selected item.
|
||||
PmenuSbar({ bg = color2, fg = color1.darken(10) }), -- Popup menu: scrollbar.
|
||||
PmenuThumb({ fg = color2 }), -- Popup menu: Thumb of the scrollbar.
|
||||
Question({ fg = color5.lighten(30) }), -- |hit-enter| prompt and yes/no questions
|
||||
QuickFixLine({ fg = white, gui = "bold" }), -- Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there.
|
||||
SpecialKey({ bg = color1, fg = black.darken(40) }), -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace|
|
||||
SpellBad({ fg = color3.darken(25), gui = "undercurl" }), -- Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise.
|
||||
SpellCap({ SpellBad }), -- Word that should start with a capital. |spell| Combined with the highlighting used otherwise.
|
||||
SpellLocal({ SpellBad }), -- Word that is recognized by the spellchecker as one that is used in another region. |spell| Combined with the highlighting used otherwise.
|
||||
SpellRare({ SpellBad }), -- Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise.
|
||||
StatusLine {}, -- {bg = black}, --{bg = color1.lighten(60), fg = color6.darken(60)}, -- status line of current window
|
||||
StatusLineNC({ fg = color2.darken(50), gui = "underline" }), -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window.
|
||||
TabLine({ StatusLineNC }), -- tab pages line, not active tab page label
|
||||
TabLineFill({ PmenuThumb }), -- tab pages line, where there are no labels
|
||||
TabLineSel({ Search }), -- tab pages line, active tab page label
|
||||
Title({
|
||||
--[[ bg = color1.lighten(10),]]
|
||||
fg = color2.lighten(20),
|
||||
}), -- titles for output from ":set all", ":autocmd" etc.
|
||||
Visual({ bg = color9.darken(20), fg = color6.saturate(20).lighten(20) }), -- Visual mode selection
|
||||
VisualNOS({ QuickFixLine }), -- Visual mode selection when vim is "Not Owning the Selection".
|
||||
WarningMsg({ bg = color1.lighten(15), fg = color6.lighten(70), gui = "bold" }), -- warning messages
|
||||
Whitespace({ NonText }), -- "nbsp", "space", "tab" and "trail" in 'listchars'
|
||||
WildMenu({ PmenuSel }), -- current match in 'wildmenu' completion
|
||||
NvimInternalError({ fg = hsl("#ab0934") }), -- Nvim internal errors
|
||||
-- These groups are not listed as default vim groups,
|
||||
-- but they are defacto standard group names for syntax highlighting.
|
||||
-- commented out groups should chain up to their "preferred" group by
|
||||
-- default,
|
||||
-- Uncomment and edit if you want more specific syntax highlighting
|
||||
|
||||
Constant({ fg = color8.darken(35) }), -- (preferred) any constant
|
||||
-- String { }, -- a string constant: "this is a string"
|
||||
-- Character { }, -- a character constant: 'c', '\n'
|
||||
-- Number { }, -- a number constant: 234, 0xff
|
||||
-- Boolean { }, -- a boolean constant: TRUE, false
|
||||
-- Float { }, -- a floating point constant: 2.3e10
|
||||
|
||||
Identifier({ fg = color5.darken(10) }), -- (preferred) any variable name
|
||||
Function({ fg = color1.lighten(30) }), -- function name (also: methods for classes)
|
||||
Statement({ fg = color4.lighten(40) }), -- (preferred) any statement
|
||||
Conditional({ fg = color4.lighten(30) }), -- if, then, else, endif, switch, etc.
|
||||
Repeat({ fg = color3.darken(20) }), -- for, do, while, etc.
|
||||
Label({ fg = color2.lighten(30) }), -- case, default, etc.
|
||||
-- Operator { }, -- "sizeof", "+", "*", etc.
|
||||
-- Keyword { }, -- any other keyword
|
||||
-- Exception { }, -- try, catch, throw
|
||||
|
||||
PreProc({ fg = color7.darken(30) }), -- (preferred) generic Preprocessor
|
||||
-- Include { }, -- preprocessor #include
|
||||
-- Define { }, -- preprocessor #define
|
||||
-- Macro { }, -- same as Define
|
||||
-- PreCondit { }, -- preprocessor #if, #else, #endif, etc.
|
||||
|
||||
Type({ fg = color1.lighten(70), gui = "bold" }), -- (preferred) int, long, char, etc.
|
||||
-- StorageClass { }, -- static, register, volatile, etc.
|
||||
-- Structure { }, -- struct, union, enum, etc.
|
||||
-- Typedef { }, -- A typedef
|
||||
|
||||
Special({ fg = color6.darken(50) }), -- (preferred) any special symbol
|
||||
-- SpecialChar { }, -- special character in a constant
|
||||
-- Tag { }, -- you can use CTRL-] on this
|
||||
-- Delimiter { }, -- character that needs attention
|
||||
-- SpecialComment { }, -- special things inside a comment
|
||||
-- Debug { }, -- debugging statements
|
||||
|
||||
Underlined({ gui = "underline" }), -- (preferred) text that stands out, HTML links
|
||||
Bold({ gui = "bold" }),
|
||||
Italic({ gui = "italic" }),
|
||||
-- ("Ignore", below, may be invisible...)
|
||||
-- Ignore { }, -- (preferred) left blank, hidden |hl-Ignore|
|
||||
|
||||
Error({ fg = color11.lighten(50), gui = "bold" }), -- (preferred) any erroneous construct
|
||||
RedrawDebugRecompose({ fg = grey }),
|
||||
Todo({ Title }), -- (preferred) anything that needs extra attention; mostly the keywords TODO FIXME and XXX
|
||||
-- These groups are for the native LSP client. Some other LSP clients may
|
||||
-- use these groups, or use their own. Consult your LSP client's
|
||||
-- documentation.
|
||||
|
||||
-- LspReferenceText { }, -- used for highlighting "text" references
|
||||
-- LspReferenceRead { }, -- used for highlighting "read" references
|
||||
-- LspReferenceWrite { }, -- used for highlighting "write" references
|
||||
|
||||
LspDiagnosticsDefaultError({ fg = hsl("#ab0934").saturate(-30).lighten(20), gui = "italic" }), -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
|
||||
LspDiagnosticsDefaultWarning({ fg = hsl("#e0ba0b").saturate(-20), gui = "italic" }), -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
|
||||
LspDiagnosticsDefaultInformation({ fg = teal.lighten(10).saturate(10), gui = "italic" }), -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
|
||||
LspDiagnosticsDefaultHint({ fg = color7, gui = "italic" }), -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
|
||||
-- LspDiagnosticsVirtualTextError { }, -- Used for "Error" diagnostic virtual text
|
||||
-- LspDiagnosticsVirtualTextWarning { }, -- Used for "Warning" diagnostic virtual text
|
||||
-- LspDiagnosticsVirtualTextInformation { }, -- Used for "Information" diagnostic virtual text
|
||||
-- LspDiagnosticsVirtualTextHint { }, -- Used for "Hint" diagnostic virtual text
|
||||
|
||||
-- LspDiagnosticsUnderlineError { }, -- Used to underline "Error" diagnostics
|
||||
-- LspDiagnosticsUnderlineWarning { fg = hsl("#e0ba0b").saturate(-50) }, -- Used to underline "Warning" diagnostics
|
||||
-- LspDiagnosticsUnderlineInformation { }, -- Used to underline "Information" diagnostics
|
||||
-- LspDiagnosticsUnderlineHint { }, -- Used to underline "Hint" diagnostics
|
||||
|
||||
LspDiagnosticsFloatingError({ fg = LspDiagnosticsDefaultError.fg, bg = black }), -- Used to color "Error" diagnostic messages in diagnostics float
|
||||
LspDiagnosticsFloatingWarning({ fg = LspDiagnosticsDefaultWarning.fg, bg = black }), -- Used to color "Warning" diagnostic messages in diagnostics float
|
||||
LspDiagnosticsFloatingInformation({ fg = LspDiagnosticsDefaultInformation.fg, bg = black }), -- Used to color "Information" diagnostic messages in diagnostics float
|
||||
LspDiagnosticsFloatingHint({ fg = LspDiagnosticsDefaultHint.fg, bg = black }), -- Used to color "Hint" diagnostic messages in diagnostics float
|
||||
-- LspDiagnosticsSignError { }, -- Used for "Error" signs in sign column
|
||||
-- LspDiagnosticsSignWarning { }, -- Used for "Warning" signs in sign column
|
||||
-- LspDiagnosticsSignInformation { }, -- Used for "Information" signs in sign column
|
||||
-- LspDiagnosticsSignHint { }, -- Used for "Hint" signs in sign column
|
||||
|
||||
-- LSP Saga
|
||||
LspSagaSignatureHelpBorder({ fg = color8.darken(70), bg = black }),
|
||||
LspSagaShTruncateLine({ fg = color8.darken(70), bg = black }),
|
||||
LspFloatWinBorder({ fg = color8.darken(70), bg = black }),
|
||||
LspFloatWinNormal({ bg = black }),
|
||||
-- These groups are for the neovim tree-sitter highlights.
|
||||
-- As of writing, tree-sitter support is a WIP, group names may change.
|
||||
-- By default, most of these groups link to an appropriate Vim group,
|
||||
-- TSError -> Error for example, so you do not have to define these unless
|
||||
-- you explicitly want to support Treesitter's improved syntax awareness.
|
||||
|
||||
-- TSAnnotation { }, -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information.
|
||||
-- TSAttribute { }, -- (unstable) TODO: docs
|
||||
TSBoolean({ fg = color6 }), -- For booleans.
|
||||
-- TSCharacter { }, -- For characters.
|
||||
-- TSComment { }, -- For comment blocks.
|
||||
TSConstructor({ fg = color6.lighten(20) }), -- For constructor calls and definitions: ` { }` in Lua, and Java constructors.
|
||||
-- TSConditional { }, -- For keywords related to conditionnals.
|
||||
TSConstant({ fg = color6 }), -- For constants
|
||||
TSConstBuiltin({ fg = color6.darken(20) }), -- For constant that are built in the language: `nil` in Lua.
|
||||
-- TSConstMacro { }, -- For constants that are defined by macros: `NULL` in C.
|
||||
TSError({ fg = hsl("#ab0934") }), -- For syntax/parser errors.
|
||||
TSException({ fg = hsl("#ab0934") }), -- For exception related keywords.
|
||||
TSField({ fg = color8.lighten(5) }), -- For fields.
|
||||
-- TSFloat { }, -- For floats.
|
||||
TSFunction({ fg = color10.lighten(10) }), -- For function (calls and definitions).
|
||||
TSFuncBuiltin({ fg = color10.darken(10).rotate(15) }), -- For builtin functions: `table.insert` in Lua.
|
||||
TSDecorator({ fg = color15.darken(20) }),
|
||||
TSFuncMacro({ fg = green }), -- For macro defined fuctions (calls and definitions): each `macro_rules` in Rust.
|
||||
TSInclude({ fg = color13.darken(10).rotate(-15) }), -- For includes: `#include` in C, `use` or `extern crate` in Rust, or `require` in Lua.
|
||||
TSKeyword({ fg = color11.lighten(10).saturate(30).rotate(20) }), -- For keywords that don't fall in previous categories.
|
||||
TSKeywordFunction({ fg = color10 }), -- For keywords used to define a fuction.
|
||||
-- TSLabel { }, -- For labels: `label:` in C and `:label:` in Lua.
|
||||
TSMethod({ fg = color4.lighten(0) }), -- For method calls and definitions.
|
||||
-- TSNamespace { }, -- For identifiers referring to modules and namespaces.
|
||||
-- TSNone { }, -- TODO: docs
|
||||
-- TSNumber { }, -- For all numbers
|
||||
-- TSOperator { }, -- For any operator: `+`, but also `->` and `*` in C.
|
||||
TSParameter({ fg = color13.lighten(20) }), -- For parameters of a function.
|
||||
-- TSParameterReference { }, -- For references to parameters of a function.
|
||||
TSProperty({ fg = color4.darken(20) }), -- Same as `TSField`.
|
||||
TSPunctDelimiter({ fg = color7.lighten(30) }), -- For delimiters ie: `.`
|
||||
TSPunctBracket({ fg = color8.darken(40) }), -- For brackets and parens.
|
||||
TSPunctSpecial({ fg = color7.lighten(10) }), -- For special punctutation that does not fall in the catagories before.
|
||||
-- TSRepeat { }, -- For keywords related to loops.
|
||||
TSString({ fg = color13.darken(10).rotate(-30) }), -- For strings.
|
||||
TSDocString({ fg = color13.darken(10).rotate(-40) }),
|
||||
-- TSStringRegex { }, -- For regexes.
|
||||
-- TSStringEscape { }, -- For escape characters within a string.
|
||||
-- TSSymbol { }, -- For identifiers referring to symbols or atoms.
|
||||
TSType({ fg = color12.rotate(5).darken(10) }), -- For types.
|
||||
TSTypeBuiltin({ fg = color14.darken(40) }), -- For builtin types.
|
||||
TSVariable({ fg = color8.lighten(30) }), -- Any variable name that does not have another highlight.
|
||||
TSVariableBuiltin({ fg = color12.lighten(10).rotate(10) }), -- Variable names that are defined by the languages, like `this` or `self`.
|
||||
-- TSTag { }, -- Tags like html tag names.
|
||||
TSTagDelimiter({ fg = color14.saturate(50).darken(20) }), -- Tag delimiter like `<` `>` `/`
|
||||
-- TSText { }, -- For strings considered text in a markup language.
|
||||
-- TSEmphasis { }, -- For text to be represented with emphasis.
|
||||
-- TSUnderline { }, -- For text to be represented with an underline.
|
||||
-- TSStrike { }, -- For strikethrough text.
|
||||
-- TSTitle { }, -- Text that is part of a title.
|
||||
-- TSLiteral { }, -- Literal text.
|
||||
-- TSURI { }, -- Any URI like a link or email.
|
||||
MyCustomGroup({ fg = green }),
|
||||
-- Telescope Groups
|
||||
TelescopeMatching({ fg = color3.lighten(5) }),
|
||||
TelescopeSelection({ fg = color4.lighten(10) }),
|
||||
TelescopeMultiSelection({ fg = color3.lighten(5) }),
|
||||
-- TelescopeNormal { bg = color1.lighten(4) },
|
||||
|
||||
-- Git Diff View
|
||||
DiffAdd{ bg = vibrant_green.rotate(0).darken(70) }, -- diff mode: Added line |diff.txt|
|
||||
DiffChange{ bg = dark_purple.darken(80) }, -- diff mode: Changed ine |diff.txt|
|
||||
DiffDelete{ bg = red.darken(70) }, -- diff mode: Deleted line |diff.txt|
|
||||
DiffText{ bg = nord_blue.darken(50) }, -- diff mode: Changed text within a changed line |diff.txt|
|
||||
DiffModified{ bg = sun.darken(60) },
|
||||
|
||||
-- Git Signs
|
||||
GitSignsAdd{ fg = vibrant_green.rotate(0).darken(50) }, -- diff mode: Added line |diff.txt|
|
||||
GitSignsChange{ fg = dark_purple.darken(60) }, -- diff mode: Changed ine |diff.txt|
|
||||
GitSignsDelete{ fg = red.darken(50) }, -- diff mode: Deleted line |diff.txt|
|
||||
GitSignsText{ fg = nord_blue.darken(40) }, -- diff mode: Changed text within a changed line |diff.txt|
|
||||
GitSignsModified{ fg = sun.darken(40) },
|
||||
-- NvimTree
|
||||
NvimTreeFolderIcon({ fg = blue }),
|
||||
NvimTreeFolderName({ fg = blue }),
|
||||
NvimTreeOpenedFolderName({ fg = blue }),
|
||||
NvimTreeEmptyFolderName({ fg = blue }),
|
||||
NvimTreeIndentMarker({ fg = one_bg2 }),
|
||||
NvimTreeVertSplit({ fg = darker_black }),
|
||||
NvimTreeEndOfBuffer({ fg = darker_black }),
|
||||
NvimTreeRootFolder({ fg = black2.lighten(50) }),
|
||||
NvimTreeNormal({ fg = grey.lighten(60) }),
|
||||
NvimTreeStatuslineNc({}),
|
||||
NvimTreeWindowPicker({ bg = black2.lighten(20), fg = red }),
|
||||
NvimTreeLspDiagnosticsError({ fg = LspDiagnosticsDefaultError.fg }),
|
||||
NvimTreeLspDiagnosticsWarning({ fg = LspDiagnosticsDefaultWarning.fg }),
|
||||
NvimTreeLspDiagnosticsInformation({ fg = LspDiagnosticsDefaultInformation.fg }),
|
||||
NvimTreeLspDiagnosticsHint({ fg = LspDiagnosticsDefaultError.fg.rotate(30) }),
|
||||
NvimTreeGitDirty({ fg = DiffModified.fg }),
|
||||
NvimTreeGitStaged({ fg = DiffAdd.fg }),
|
||||
NvimTreeGitMerge({ fg = dark_purple }),
|
||||
NvimTreeGitRenamed({ fg = DiffModified.fg }),
|
||||
NvimTreeGitNew({ fg = cyan }),
|
||||
NvimTreeGitDeleted({ fg = DiffDelete.fg }),
|
||||
NvimTreeGitIgnored({ fg = DiffText.fg }),
|
||||
-- Buffer lines or smth, not sure yet what this does
|
||||
-- BufferLineFill {fg = grey_fg},
|
||||
-- BufferLineBackground {fg = light_grey},
|
||||
-- BufferLineBufferVisible {fg = light_grey},
|
||||
-- BufferLineBufferSelected {fg = white, gui = "bold"},
|
||||
-- -- tabs
|
||||
-- BufferLineTab {fg = light_grey, bg = one_bg3},
|
||||
-- BufferLineTabSelected {fg = black2, bg = nord_blue},
|
||||
-- BufferLineTabClose {fg = red},
|
||||
-- BufferLineIndicator {fg = red},
|
||||
-- BufferLineIndicatorSelected {fg = color4},
|
||||
-- -- separators
|
||||
-- BufferLineSeparator {fg = color4},
|
||||
-- BufferLineSeparatorVisible {fg = green},
|
||||
-- BufferLineSeparatorSelected {fg = blue},
|
||||
-- -- modified buffers
|
||||
-- BufferLineModified {fg = red, bg = black2},
|
||||
-- BufferLineModifiedVisible {fg = blue, bg = black2},
|
||||
-- BufferLineModifiedSelected {fg = green, bg = black},
|
||||
-- -- close buttons
|
||||
-- BufferLineCloseButtonVisible {fg = light_grey},
|
||||
-- BufferLineCloseButton {fg = light_grey},
|
||||
-- BufferLineCloseButtonSelected {fg = red},
|
||||
|
||||
-- Raw list of bufferline items, some don't really do much, hard to find which ones do
|
||||
-- BufferLineTab xxx guifg=#ffffff guibg=#fff
|
||||
-- BufferLineHintDiagnosticVisible xxx guifg=#849aa5
|
||||
-- BufferLineHintDiagnostic xxx guifg=#849aa5 guisp=#9e9e9e
|
||||
-- BufferLineHintSelected xxx gui=bold,italic guifg=#d3d3d3 guisp=#d3d3d3
|
||||
-- BufferLineHintVisible xxx guifg=#b0cedd
|
||||
-- BufferLineDiagnosticSelected xxx gui=bold,italic guifg=#8d8f9d
|
||||
-- BufferLineDiagnosticVisible xxx guifg=#849aa5
|
||||
-- BufferLineBufferSelected xxx gui=bold,italic guifg=#bcbfd2 guibg=#ffffff
|
||||
--
|
||||
-- If the buffer is visible in one of the windows
|
||||
-- BufferLineBufferVisible xxx guifg=#b0cedd guibg=#ffffff
|
||||
--
|
||||
-- Filling on the right side remaining space
|
||||
-- BufferLineFill xxx guifg=#b0cedd guibg=#ffffff
|
||||
-- BufferLineCloseButtonVisible xxx guifg=#b0cedd
|
||||
-- BufferLineCloseButton xxx guifg=#b0cedd
|
||||
-- BufferLineTabClose xxx guifg=#b0cedd
|
||||
-- BufferLineTabSelected xxx guifg=#d1e0e0
|
||||
-- BufferLineGroupLabel xxx guibg=#b0cedd
|
||||
-- BufferLineGroupSeparator xxx guifg=#b0cedd
|
||||
-- BufferLineModified xxx guifg=#80a8a8
|
||||
-- BufferLineDiagnostic xxx guifg=#849aa5
|
||||
-- BufferLineWarning xxx guifg=#b0cedd guisp=#ffa500
|
||||
-- BufferLineHintDiagnosticSelected xxx gui=bold,italic guifg=#9e9e9e guisp=#9e9e9e
|
||||
-- BufferLineError xxx guifg=#b0cedd guisp=#ff0000
|
||||
-- BufferLineInfoDiagnostic xxx guifg=#849aa5 guisp=#81a2ac
|
||||
-- BufferLineCloseButtonSelected xxx guifg=#bcbfd2
|
||||
-- BufferLineInfo xxx guifg=#b0cedd guisp=#add8e6
|
||||
-- BufferLinePickSelected xxx gui=bold,italic guifg=#ff0000
|
||||
-- BufferLinePick xxx gui=bold,italic guifg=#ff0000
|
||||
-- BufferLineDuplicate xxx gui=italic guifg=#a7c3d1
|
||||
-- BufferLinePickVisible xxx gui=bold,italic guifg=#ff0000
|
||||
-- BufferLineBuffer xxx guifg=#b0cedd guibg=#ffffff
|
||||
-- BufferLineSeparator xxx cleared
|
||||
-- BufferLineIndicatorSelected xxx guifg=#d1e0e0
|
||||
-- BufferLineSeparatorVisible xxx cleared
|
||||
-- BufferLineSeparatorSelected xxx cleared
|
||||
-- BufferLineDuplicateVisible xxx gui=italic guifg=#a7c3d1
|
||||
-- BufferLineDuplicateSelected xxx gui=italic guifg=#a7c3d1
|
||||
-- BufferLineModifiedSelected xxx guifg=#80a8a8
|
||||
-- BufferLineModifiedVisible xxx guifg=#80a8a8
|
||||
-- BufferLineErrorDiagnosticSelected xxx gui=bold,italic guifg=#bf0000 guisp=#bf0000
|
||||
-- BufferLineErrorDiagnosticVisible xxx guifg=#849aa5
|
||||
-- BufferLineErrorDiagnostic xxx guifg=#849aa5 guisp=#bf0000
|
||||
-- BufferLineErrorSelected xxx gui=bold,italic guifg=#ff0000 guisp=#ff0000
|
||||
-- BufferLineErrorVisible xxx guifg=#b0cedd
|
||||
-- BufferLineWarningDiagnosticSelected xxx gui=bold,italic guifg=#bf7b00 guisp=#bf7b00
|
||||
-- BufferLineWarningDiagnosticVisible xxx guifg=#849aa5
|
||||
-- BufferLineWarningDiagnostic xxx guifg=#849aa5 guisp=#bf7b00
|
||||
-- BufferLineHint xxx guifg=#b0cedd guisp=#d3d3d3
|
||||
-- BufferLineWarningSelected xxx gui=bold,italic guifg=#ffa500 guisp=#ffa500
|
||||
-- BufferLineWarningVisible xxx guifg=#b0cedd
|
||||
-- BufferLineInfoDiagnosticSelected xxx gui=bold,italic guifg=#81a2ac guisp=#81a2ac
|
||||
-- BufferLineInfoDiagnosticVisible xxx guifg=#849aa5
|
||||
--
|
||||
-- Background of all escept visible
|
||||
-- BufferLineBackground xxx guifg=#b0cedd
|
||||
-- BufferLineInfoSelected xxx gui=bold,italic guifg=#add8e6 guisp=#add8e6
|
||||
-- BufferLineInfoVisible xxx guifg=#b0cedd
|
||||
-- Notify
|
||||
NotifyERRORBorder({ fg = "#8A1F1F" }),
|
||||
NotifyWARNBorder({ fg = "#79491D" }),
|
||||
NotifyINFOBorder({ fg = "#4F6752" }),
|
||||
NotifyDEBUGBorder({ fg = "#8B8B8B" }),
|
||||
NotifyTRACEBorder({ fg = "#4F3552" }),
|
||||
NotifyERRORIcon({ fg = "#F70067" }),
|
||||
NotifyWARNIcon({ fg = "#F79000" }),
|
||||
NotifyINFOIcon({ fg = "#A9FF68" }),
|
||||
NotifyDEBUGIcon({ fg = "#8B8B8B" }),
|
||||
NotifyTRACEIcon({ fg = "#D484FF" }),
|
||||
NotifyERRORTitle({ fg = "#F70067" }),
|
||||
NotifyWARNTitle({ fg = "#F79000" }),
|
||||
NotifyINFOTitle({ fg = "#A9FF68" }),
|
||||
NotifyDEBUGTitle({ fg = "#8B8B8B" }),
|
||||
NotifyTRACETitle({ fg = "#D484FF" }),
|
||||
NotifyERRORBody({ fg = Normal.fg }),
|
||||
NotifyWARNBody({ fg = Normal.fg }),
|
||||
NotifyINFOBody({ fg = Normal.fg }),
|
||||
NotifyDEBUGBody({ fg = Normal.fg }),
|
||||
NotifyTRACEBody({ fg = Normal.fg }),
|
||||
-- Modes
|
||||
ModesCopy({ bg = "#f5c359" }),
|
||||
ModesDelete({ bg = "#c75c6a" }),
|
||||
ModesInsert({ bg = "#78ccc5" }),
|
||||
ModesVisual({ bg = color2.lighten(30) }),
|
||||
packerStatusFail({ fg = pink.darken(40).saturate(-20) }), -- error messages on the command line
|
||||
}
|
||||
end)
|
||||
|
||||
-- Define your lightline theme using groups from our lush spec
|
||||
--
|
||||
-- This theme simply flips the background and foreground colours
|
||||
-- for normal and insert mode.
|
||||
--
|
||||
-- Continue below to see how to enable real time updating,
|
||||
-- then try editing this theme.
|
||||
--- local lightline_theme = {
|
||||
--- normal = {
|
||||
--- left = {
|
||||
--- {theme.CursorLineNr.fg.hex, theme.CursorLineNr.bg.hex},
|
||||
--- },
|
||||
--- middle = {
|
||||
--- {theme.Normal.fg.hex, theme.Normal.bg.hex},
|
||||
--- },
|
||||
--- right = {
|
||||
--- {theme.StatusLine.fg.hex, theme.StatusLine.bg.hex},
|
||||
--- },
|
||||
--- },
|
||||
--- insert = {
|
||||
--- left = {
|
||||
--- {theme.PmenuSbar.bg.hex, theme.PmenuSbar.fg.hex},
|
||||
--- },
|
||||
--- middle = {
|
||||
--- {theme.Normal.bg.hex, theme.Normal.fg.hex},
|
||||
--- },
|
||||
--- right = {
|
||||
--- {theme.StatusLine.bg.hex, theme.StatusLine.fg.hex},
|
||||
--- },
|
||||
--- },
|
||||
--- replace = {
|
||||
--- left = {
|
||||
--- {theme.Pmenu.bg.hex, theme.Pmenu.fg.hex},
|
||||
--- },
|
||||
--- middle = {
|
||||
--- {theme.Normal.bg.hex, theme.Normal.fg.hex},
|
||||
--- },
|
||||
--- right = {
|
||||
--- {theme.StatusLine.bg.hex, theme.StatusLine.fg.hex},
|
||||
--- },
|
||||
--- },
|
||||
--- visual = {
|
||||
--- left = {
|
||||
--- {theme.WarningMsg.bg.hex, theme.WarningMsg.fg.hex},
|
||||
--- },
|
||||
--- middle = {
|
||||
--- {theme.Normal.bg.hex, theme.Normal.fg.hex},
|
||||
--- },
|
||||
--- right = {
|
||||
--- {theme.StatusLine.bg.hex, theme.StatusLine.fg.hex},
|
||||
--- },
|
||||
--- },
|
||||
--- }
|
||||
|
||||
-- Use lightlines helper functions to correct cterm holes in our theme.
|
||||
-- Note: These functions can be expensive to run, it is recommended you
|
||||
-- leave them commented out until you wish to work on lightline,
|
||||
-- or investigate the two-file approach in the other lightline example.
|
||||
-- local lightline_theme_filled = vim.fn['lightline#colorscheme#fill'](lightline_theme)
|
||||
|
||||
-- define our theme for lightline to find
|
||||
-- vim.g['lightline#colorscheme#lightline_one_file#palette'] = lightline_theme_filled
|
||||
|
||||
-- Technically, that's all you have to do for your lightline theme to
|
||||
-- be applied but if you want real-time feedback while designing it, you must
|
||||
-- include some extra code which forces lightline to notice the changes.
|
||||
--
|
||||
-- It's recommended you comment out the following code if you're not actively
|
||||
-- editing your lightline theme.
|
||||
--
|
||||
-- You may find realtime performance unacceptable while changes are being
|
||||
-- propagated back to and applied by vimscript, if this is a problem,
|
||||
-- you can disable lush.ify() on the buffer (save then `:e!`), then when you
|
||||
-- wish to preview your changes, save and run `:luafile %`.
|
||||
--
|
||||
-- Consider making a temporary mapping while working:
|
||||
--
|
||||
-- `:nmap <leader>llr :luafile %<CR>`
|
||||
|
||||
-- Lightline is a little tempermental about when you tell it to update it's
|
||||
-- theme, so we push it to vim's scheduler.
|
||||
-- vim.schedule(function()
|
||||
-- -- lightline#colorscheme() has a side effect of not always
|
||||
-- applying updates until after leaving insert mode.
|
||||
-- vim.fn['lightline#colorscheme']()
|
||||
|
||||
-- this will apply more uniforming across all modes, but may have
|
||||
-- unacceptable performance impacts.
|
||||
-- vim.fn['lightline#disable']()
|
||||
-- vim.fn['lightline#enable']()
|
||||
-- return our parsed theme for extension or use else where.
|
||||
--
|
||||
-- end)
|
||||
return theme
|
||||
|
||||
-- vi:nowrap
|
@ -0,0 +1,364 @@
|
||||
|
||||
--
|
||||
-- Built with,
|
||||
--
|
||||
-- ,gggg,
|
||||
-- d8" "8I ,dPYb,
|
||||
-- 88 ,dP IP'`Yb
|
||||
-- 8888888P" I8 8I
|
||||
-- 88 I8 8'
|
||||
-- 88 gg gg ,g, I8 dPgg,
|
||||
-- ,aa,_88 I8 8I ,8'8, I8dP" "8I
|
||||
-- dP" "88P I8, ,8I ,8' Yb I8P I8
|
||||
-- Yb,_,d88b,,_ ,d8b, ,d8b,,8'_ 8) ,d8 I8,
|
||||
-- "Y8P" "Y888888P'"Y88P"`Y8P' "YY8P8P88P `Y8
|
||||
--
|
||||
|
||||
-- This is a starter colorscheme for use with Lush,
|
||||
-- for usage guides, see :h lush or :LushRunTutorial
|
||||
|
||||
--
|
||||
-- Note: Because this is lua file, vim will append your file to the runtime,
|
||||
-- which means you can require(...) it in other lua code (this is useful),
|
||||
-- but you should also take care not to conflict with other libraries.
|
||||
--
|
||||
-- (This is a lua quirk, as it has somewhat poor support for namespacing.)
|
||||
--
|
||||
-- Basically, name your file,
|
||||
--
|
||||
-- "super_theme/lua/lush_theme/super_theme_dark.lua",
|
||||
--
|
||||
-- not,
|
||||
--
|
||||
-- "super_theme/lua/dark.lua".
|
||||
--
|
||||
-- With that caveat out of the way...
|
||||
--
|
||||
|
||||
-- Enable lush.ify on this file, run:
|
||||
--
|
||||
-- `:Lushify`
|
||||
--
|
||||
-- or
|
||||
--
|
||||
-- `:lua require('lush').ify()`
|
||||
|
||||
local lush = require('lush')
|
||||
local hsl = lush.hsl
|
||||
|
||||
local theme = lush(function()
|
||||
return {
|
||||
-- The following are all the Neovim default highlight groups from the docs
|
||||
-- as of 0.5.0-nightly-446, to aid your theme creation. Your themes should
|
||||
-- probably style all of these at a bare minimum.
|
||||
--
|
||||
-- Referenced/linked groups must come before being referenced/lined,
|
||||
-- so the order shown ((mostly) alphabetical) is likely
|
||||
-- not the order you will end up with.
|
||||
--
|
||||
-- You can uncomment these and leave them empty to disable any
|
||||
-- styling for that group (meaning they mostly get styled as Normal)
|
||||
-- or leave them commented to apply vims default colouring or linking.
|
||||
|
||||
Comment { bg = hsl(328,7,39), fg = hsl(190,99,82).darken(70), gui = "italic" }, -- any comment
|
||||
ColorColumn { bg = hsl(328,7,39).darken(60) }, -- used for the columns set with 'colorcolumn'
|
||||
Conceal { bg = hsl(328,7,39), fg = hsl(199,31,43).darken(60) }, -- placeholder characters substituted for concealed text (see 'conceallevel')
|
||||
Cursor { bg = hsl(328,7,39), fg = hsl(328,17,50) }, -- character under the cursor
|
||||
lCursor { bg = hsl(200,31,66), fg = hsl(198,52,56).darken(30) }, -- the character under the cursor when |language-mapping| is used (see 'guicursor')
|
||||
CursorIM { bg = hsl(200,41,72), fg = hsl(328,7,39) }, -- like Cursor, but used when in IME mode |CursorIM|
|
||||
CursorColumn { bg = hsl(328,7,39), fg = hsl(200,31,75) }, -- Screen-column at the cursor, when 'cursorcolumn' is set.
|
||||
CursorLine { bg = hsl(199,31,43).darken(40), fg = hsl(199,31,43).lighten(40) }, -- Screen-line at the cursor, when 'cursorline' is set. Low-priority if foreground (ctermfg OR guifg) is not set.
|
||||
Directory { bg = hsl(328,7,39), fg = hsl(200,41,72) }, -- directory names (and other special names in listings)
|
||||
DiffAdd { bg = hsl(328,7,39), fg = hsl(200,41,72) }, -- diff mode: Added line |diff.txt|
|
||||
DiffChange { bg = hsl(328,7,39), fg = hsl(190,99,82).lighten(30)}, -- diff mode: Changed line |diff.txt|
|
||||
DiffDelete { bg = hsl(328,7,39), fg = hsl(201,16,56).lighten(30)}, -- diff mode: Deleted line |diff.txt|
|
||||
DiffText { bg = hsl(328,7,39), fg = hsl(200,41,72).lighten(40)}, -- diff mode: Changed text within a changed line |diff.txt|
|
||||
EndOfBuffer { bg = hsl(328,7,39), fg = hsl(199,31,43).darken(55) }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|.
|
||||
TermCursor { bg = hsl(200,41,72), fg = hsl(328,7,39) }, -- cursor in a focused terminal
|
||||
TermCursorNC { bg = hsl(200,31,66), fg = hsl(328,7,39) }, -- cursor in an unfocused terminal
|
||||
ErrorMsg { bg = hsl(200,31,66).lighten(50), fg = hsl(328,7,39) }, -- error messages on the command line
|
||||
VertSplit { bg = hsl(201,32,38), fg = hsl(199,31,43) }, -- the column separating vertically split windows
|
||||
Folded { bg = hsl(328,7,39), fg = hsl(200,31,66).darken(30)}, -- line used for closed folds
|
||||
FoldColumn { bg = hsl(328,7,39), fg = hsl(200,31,66) }, -- 'foldcolumn'
|
||||
SignColumn { bg = hsl(328,7,39), fg = hsl(200,41,72) }, -- column where |signs| are displayed
|
||||
IncSearch { bg = hsl(200,31,75), fg = hsl(328,7,39) }, -- 'incsearch' highlighting; also used for the text replaced with ":s///c"
|
||||
Substitute { bg = hsl(0,0,77), fg = hsl(328,7,39) }, -- |:substitute| replacement text highlighting
|
||||
LineNr { bg = hsl(328,7,39), fg = hsl(202,49,50) }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
|
||||
CursorLineNr { bg = hsl(202,49,50).lighten(35), fg = hsl(328,7,39).darken(30) }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
|
||||
MatchParen { bg = hsl(328,7,39), fg = hsl(328,7,39).lighten(50) }, -- The character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt|
|
||||
ModeMsg { bg = hsl(328,7,39).lighten(10), fg = hsl(200,41,72) }, -- 'showmode' message (e.g., "-- INSERT -- ")
|
||||
MsgArea { bg = hsl(328,7,39).lighten(5), fg = hsl(200,41,72).darken(15) }, -- Area for messages and cmdline
|
||||
MsgSeparator { bg = hsl(328,7,39).darken(80), fg = hsl(201,16,56).lighten(60) }, -- Separator for scrolled messages, `msgsep` flag of 'display'
|
||||
MoreMsg { bg = hsl(328,7,39), fg = hsl(200,41,72).lighten(10), gui = "italic" }, -- |more-prompt|
|
||||
NonText { bg = hsl(328,7,39), fg = hsl(199,31,43).darken(30), ctermbg=none }, -- '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|.
|
||||
Normal { bg = hsl(328,7,39), fg = hsl(328,7,39).lighten(40), ctermbg=none }, -- normal text
|
||||
NormalFloat { bg = hsl(0,0,77), fg = hsl(199,31,43).darken(40)}, -- Normal text in floating windows.
|
||||
NormalNC { bg = hsl(328,7,39), fg = hsl(328,17,50).darken(70)}, -- normal text in non-current windows
|
||||
Pmenu { bg = hsl(328,7,39).lighten(30), fg = hsl(200,31,75) }, -- Popup menu: normal item.
|
||||
PmenuSel { bg = hsl(201,16,56).lighten(30), fg = hsl(202,49,50) }, -- Popup menu: selected item.
|
||||
PmenuSbar { bg = hsl(199,31,43), fg = hsl(328,7,39) }, -- Popup menu: scrollbar.
|
||||
PmenuThumb { bg = hsl(328,7,39), fg = hsl(199,31,43) }, -- Popup menu: Thumb of the scrollbar.
|
||||
Question { bg = hsl(328,7,39), fg = hsl(201,16,56).lighten(30) }, -- |hit-enter| prompt and yes/no questions
|
||||
QuickFixLine { bg = hsl(200,31,66), fg = hsl(328,17,50)}, -- Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there.
|
||||
Search { bg = hsl(200,31,75).darken(20), fg = hsl(199,31,43).lighten(10)}, -- Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand out.
|
||||
SpecialKey { bg = hsl(328,7,39) , fg = hsl(200,31,75).darken(40) }, -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace|
|
||||
SpellBad { bg = hsl(328,7,39), fg = hsl(200,31,66).darken(25), gui = "undercurl" }, -- Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise.
|
||||
SpellCap { SpellBad}, -- Word that should start with a capital. |spell| Combined with the highlighting used otherwise.
|
||||
SpellLocal { SpellBad}, -- Word that is recognized by the spellchecker as one that is used in another region. |spell| Combined with the highlighting used otherwise.
|
||||
SpellRare { SpellBad}, -- Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise.
|
||||
StatusLine { bg = hsl(328,7,39).lighten(60), fg = hsl(200,41,72).darken(60) }, -- status line of current window
|
||||
StatusLineNC { bg = hsl(328,17,50).darken(70), fg = hsl(199,31,43).lighten(10)}, -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window.
|
||||
TabLine { StatusLineNC}, -- tab pages line, not active tab page label
|
||||
TabLineFill { PmenuThumb }, -- tab pages line, where there are no labels
|
||||
TabLineSel { Search }, -- tab pages line, active tab page label
|
||||
Title { bg = hsl(328,7,39).lighten(10),fg = hsl(328,7,39).lighten(40) }, -- titles for output from ":set all", ":autocmd" etc.
|
||||
Visual { bg = hsl(328,17,50), fg = hsl(328,7,39) }, -- Visual mode selection
|
||||
VisualNOS { QuickFixLine}, -- Visual mode selection when vim is "Not Owning the Selection".
|
||||
WarningMsg { bg = hsl(328,7,39).lighten(15), fg = hsl(200,41,72).lighten(70), gui="bold" }, -- warning messages
|
||||
Whitespace { NonText}, -- "nbsp", "space", "tab" and "trail" in 'listchars'
|
||||
WildMenu { PmenuSel}, -- current match in 'wildmenu' completion
|
||||
|
||||
-- These groups are not listed as default vim groups,
|
||||
-- but they are defacto standard group names for syntax highlighting.
|
||||
-- commented out groups should chain up to their "preferred" group by
|
||||
-- default,
|
||||
-- Uncomment and edit if you want more specific syntax highlighting.
|
||||
|
||||
Constant { bg = hsl(328,7,39), fg = hsl(200,31,75).darken(35) }, -- (preferred) any constant
|
||||
-- String { }, -- a string constant: "this is a string"
|
||||
-- Character { }, -- a character constant: 'c', '\n'
|
||||
-- Number { }, -- a number constant: 234, 0xff
|
||||
-- Boolean { }, -- a boolean constant: TRUE, false
|
||||
-- Float { }, -- a floating point constant: 2.3e10
|
||||
|
||||
Identifier { bg = hsl(328,7,39), fg = hsl(201,16,56).darken(30) }, -- (preferred) any variable name
|
||||
Function { bg = hsl(328,7,39), fg = hsl(328,7,39).lighten(30)}, -- function name (also: methods for classes)
|
||||
|
||||
Statement { bg = hsl(328,7,39), fg = hsl(201,32,38).lighten(40) }, -- (preferred) any statement
|
||||
Conditional { bg = hsl(328,7,39), fg = hsl(201,32,38).lighten(30) }, -- if, then, else, endif, switch, etc.
|
||||
Repeat { bg = hsl(328,7,39), fg = hsl(200,31,66).darken(20) }, -- for, do, while, etc.
|
||||
Label { bg = hsl(328,7,39), fg = hsl(199,31,43).lighten(30) }, -- case, default, etc.
|
||||
-- Operator { }, -- "sizeof", "+", "*", etc.
|
||||
-- Keyword { }, -- any other keyword
|
||||
-- Exception { }, -- try, catch, throw
|
||||
|
||||
PreProc { bg = hsl(328,7,39), fg = hsl(0,0,77).darken(30)}, -- (preferred) generic Preprocessor
|
||||
-- Include { }, -- preprocessor #include
|
||||
-- Define { }, -- preprocessor #define
|
||||
-- Macro { }, -- same as Define
|
||||
-- PreCondit { }, -- preprocessor #if, #else, #endif, etc.
|
||||
|
||||
Type { bg = hsl(328,7,39), fg = hsl(328,7,39).lighten(70), gui = "bold" }, -- (preferred) int, long, char, etc.
|
||||
-- StorageClass { }, -- static, register, volatile, etc.
|
||||
-- Structure { }, -- struct, union, enum, etc.
|
||||
-- Typedef { }, -- A typedef
|
||||
|
||||
Special { bg = hsl(328,7,39), fg=hsl(200,41,72).darken(50)}, -- (preferred) any special symbol
|
||||
-- SpecialChar { }, -- special character in a constant
|
||||
-- Tag { }, -- you can use CTRL-] on this
|
||||
-- Delimiter { }, -- character that needs attention
|
||||
-- SpecialComment { }, -- special things inside a comment
|
||||
-- Debug { }, -- debugging statements
|
||||
|
||||
Underlined { gui = "underline" }, -- (preferred) text that stands out, HTML links
|
||||
Bold { gui = "bold" },
|
||||
Italic { gui = "italic" },
|
||||
|
||||
-- ("Ignore", below, may be invisible...)
|
||||
-- Ignore { }, -- (preferred) left blank, hidden |hl-Ignore|
|
||||
|
||||
Error { bg = hsl(200,41,72).darken(70), fg = hsl(190,99,82).lighten(50),gui="bold"}, -- (preferred) any erroneous construct
|
||||
|
||||
Todo { Title}, -- (preferred) anything that needs extra attention; mostly the keywords TODO FIXME and XXX
|
||||
|
||||
-- These groups are for the native LSP client. Some other LSP clients may
|
||||
-- use these groups, or use their own. Consult your LSP client's
|
||||
-- documentation.
|
||||
|
||||
-- LspReferenceText { }, -- used for highlighting "text" references
|
||||
-- LspReferenceRead { }, -- used for highlighting "read" references
|
||||
-- LspReferenceWrite { }, -- used for highlighting "write" references
|
||||
|
||||
-- LspDiagnosticsDefaultError { }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
|
||||
-- LspDiagnosticsDefaultWarning { }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
|
||||
-- LspDiagnosticsDefaultInformation { }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
|
||||
-- LspDiagnosticsDefaultHint { }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
|
||||
|
||||
-- LspDiagnosticsVirtualTextError { }, -- Used for "Error" diagnostic virtual text
|
||||
-- LspDiagnosticsVirtualTextWarning { }, -- Used for "Warning" diagnostic virtual text
|
||||
-- LspDiagnosticsVirtualTextInformation { }, -- Used for "Information" diagnostic virtual text
|
||||
-- LspDiagnosticsVirtualTextHint { }, -- Used for "Hint" diagnostic virtual text
|
||||
|
||||
-- LspDiagnosticsUnderlineError { }, -- Used to underline "Error" diagnostics
|
||||
-- LspDiagnosticsUnderlineWarning { }, -- Used to underline "Warning" diagnostics
|
||||
-- LspDiagnosticsUnderlineInformation { }, -- Used to underline "Information" diagnostics
|
||||
-- LspDiagnosticsUnderlineHint { }, -- Used to underline "Hint" diagnostics
|
||||
|
||||
-- LspDiagnosticsFloatingError { }, -- Used to color "Error" diagnostic messages in diagnostics float
|
||||
-- LspDiagnosticsFloatingWarning { }, -- Used to color "Warning" diagnostic messages in diagnostics float
|
||||
-- LspDiagnosticsFloatingInformation { }, -- Used to color "Information" diagnostic messages in diagnostics float
|
||||
-- LspDiagnosticsFloatingHint { }, -- Used to color "Hint" diagnostic messages in diagnostics float
|
||||
|
||||
-- LspDiagnosticsSignError { }, -- Used for "Error" signs in sign column
|
||||
-- LspDiagnosticsSignWarning { }, -- Used for "Warning" signs in sign column
|
||||
-- LspDiagnosticsSignInformation { }, -- Used for "Information" signs in sign column
|
||||
-- LspDiagnosticsSignHint { }, -- Used for "Hint" signs in sign column
|
||||
|
||||
-- These groups are for the neovim tree-sitter highlights.
|
||||
-- As of writing, tree-sitter support is a WIP, group names may change.
|
||||
-- By default, most of these groups link to an appropriate Vim group,
|
||||
-- TSError -> Error for example, so you do not have to define these unless
|
||||
-- you explicitly want to support Treesitter's improved syntax awareness.
|
||||
|
||||
-- TSAnnotation { }; -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information.
|
||||
-- TSAttribute { }; -- (unstable) TODO: docs
|
||||
-- TSBoolean { }; -- For booleans.
|
||||
-- TSCharacter { }; -- For characters.
|
||||
-- TSComment { }; -- For comment blocks.
|
||||
-- TSConstructor { }; -- For constructor calls and definitions: ` { }` in Lua, and Java constructors.
|
||||
-- TSConditional { }; -- For keywords related to conditionnals.
|
||||
-- TSConstant { }; -- For constants
|
||||
-- TSConstBuiltin { }; -- For constant that are built in the language: `nil` in Lua.
|
||||
-- TSConstMacro { }; -- For constants that are defined by macros: `NULL` in C.
|
||||
-- TSError { }; -- For syntax/parser errors.
|
||||
-- TSException { }; -- For exception related keywords.
|
||||
-- TSField { }; -- For fields.
|
||||
-- TSFloat { }; -- For floats.
|
||||
-- TSFunction { }; -- For function (calls and definitions).
|
||||
-- TSFuncBuiltin { }; -- For builtin functions: `table.insert` in Lua.
|
||||
-- TSFuncMacro { }; -- For macro defined fuctions (calls and definitions): each `macro_rules` in Rust.
|
||||
-- TSInclude { }; -- For includes: `#include` in C, `use` or `extern crate` in Rust, or `require` in Lua.
|
||||
-- TSKeyword { }; -- For keywords that don't fall in previous categories.
|
||||
-- TSKeywordFunction { }; -- For keywords used to define a fuction.
|
||||
-- TSLabel { }; -- For labels: `label:` in C and `:label:` in Lua.
|
||||
-- TSMethod { }; -- For method calls and definitions.
|
||||
-- TSNamespace { }; -- For identifiers referring to modules and namespaces.
|
||||
-- TSNone { }; -- TODO: docs
|
||||
-- TSNumber { }; -- For all numbers
|
||||
-- TSOperator { }; -- For any operator: `+`, but also `->` and `*` in C.
|
||||
-- TSParameter { }; -- For parameters of a function.
|
||||
-- TSParameterReference { }; -- For references to parameters of a function.
|
||||
-- TSProperty { }; -- Same as `TSField`.
|
||||
-- TSPunctDelimiter { }; -- For delimiters ie: `.`
|
||||
-- TSPunctBracket { }; -- For brackets and parens.
|
||||
-- TSPunctSpecial { }; -- For special punctutation that does not fall in the catagories before.
|
||||
-- TSRepeat { }; -- For keywords related to loops.
|
||||
-- TSString { }; -- For strings.
|
||||
-- TSStringRegex { }; -- For regexes.
|
||||
-- TSStringEscape { }; -- For escape characters within a string.
|
||||
-- TSSymbol { }; -- For identifiers referring to symbols or atoms.
|
||||
-- TSType { }; -- For types.
|
||||
-- TSTypeBuiltin { }; -- For builtin types.
|
||||
-- TSVariable { }; -- Any variable name that does not have another highlight.
|
||||
-- TSVariableBuiltin { }; -- Variable names that are defined by the languages, like `this` or `self`.
|
||||
|
||||
-- TSTag { }; -- Tags like html tag names.
|
||||
-- TSTagDelimiter { }; -- Tag delimiter like `<` `>` `/`
|
||||
-- TSText { }; -- For strings considered text in a markup language.
|
||||
-- TSEmphasis { }; -- For text to be represented with emphasis.
|
||||
-- TSUnderline { }; -- For text to be represented with an underline.
|
||||
-- TSStrike { }; -- For strikethrough text.
|
||||
-- TSTitle { }; -- Text that is part of a title.
|
||||
-- TSLiteral { }; -- Literal text.
|
||||
-- TSURI { }; -- Any URI like a link or email.
|
||||
|
||||
}
|
||||
end
|
||||
)
|
||||
|
||||
-- Define your lightline theme using groups from our lush spec
|
||||
--
|
||||
-- This theme simply flips the background and foreground colours
|
||||
-- for normal and insert mode.
|
||||
--
|
||||
-- Continue below to see how to enable real time updating,
|
||||
-- then try editing this theme.
|
||||
--- local lightline_theme = {
|
||||
--- normal = {
|
||||
--- left = {
|
||||
--- {theme.CursorLineNr.fg.hex, theme.CursorLineNr.bg.hex},
|
||||
--- },
|
||||
--- middle = {
|
||||
--- {theme.Normal.fg.hex, theme.Normal.bg.hex},
|
||||
--- },
|
||||
--- right = {
|
||||
--- {theme.StatusLine.fg.hex, theme.StatusLine.bg.hex},
|
||||
--- },
|
||||
--- },
|
||||
--- insert = {
|
||||
--- left = {
|
||||
--- {theme.PmenuSbar.bg.hex, theme.PmenuSbar.fg.hex},
|
||||
--- },
|
||||
--- middle = {
|
||||
--- {theme.Normal.bg.hex, theme.Normal.fg.hex},
|
||||
--- },
|
||||
--- right = {
|
||||
--- {theme.StatusLine.bg.hex, theme.StatusLine.fg.hex},
|
||||
--- },
|
||||
--- },
|
||||
--- replace = {
|
||||
--- left = {
|
||||
--- {theme.Pmenu.bg.hex, theme.Pmenu.fg.hex},
|
||||
--- },
|
||||
--- middle = {
|
||||
--- {theme.Normal.bg.hex, theme.Normal.fg.hex},
|
||||
--- },
|
||||
--- right = {
|
||||
--- {theme.StatusLine.bg.hex, theme.StatusLine.fg.hex},
|
||||
--- },
|
||||
--- },
|
||||
--- visual = {
|
||||
--- left = {
|
||||
--- {theme.WarningMsg.bg.hex, theme.WarningMsg.fg.hex},
|
||||
--- },
|
||||
--- middle = {
|
||||
--- {theme.Normal.bg.hex, theme.Normal.fg.hex},
|
||||
--- },
|
||||
--- right = {
|
||||
--- {theme.StatusLine.bg.hex, theme.StatusLine.fg.hex},
|
||||
--- },
|
||||
--- },
|
||||
--- }
|
||||
|
||||
-- Use lightlines helper functions to correct cterm holes in our theme.
|
||||
-- Note: These functions can be expensive to run, it is recommended you
|
||||
-- leave them commented out until you wish to work on lightline,
|
||||
-- or investigate the two-file approach in the other lightline example.
|
||||
--- local lightline_theme_filled = vim.fn['lightline#colorscheme#fill'](lightline_theme)
|
||||
|
||||
-- define our theme for lightline to find
|
||||
--- vim.g['lightline#colorscheme#lightline_one_file#palette'] = lightline_theme_filled
|
||||
|
||||
-- Technically, that's all you have to do for your lightline theme to
|
||||
-- be applied but if you want real-time feedback while designing it, you must
|
||||
-- include some extra code which forces lightline to notice the changes.
|
||||
--
|
||||
-- It's recommended you comment out the following code if you're not actively
|
||||
-- editing your lightline theme.
|
||||
--
|
||||
-- You may find realtime performance unacceptable while changes are being
|
||||
-- propagated back to and applied by vimscript, if this is a problem,
|
||||
-- you can disable lush.ify() on the buffer (save then `:e!`), then when you
|
||||
-- wish to preview your changes, save and run `:luafile %`.
|
||||
--
|
||||
-- Consider making a temporary mapping while working:
|
||||
--
|
||||
-- `:nmap <leader>llr :luafile %<CR>`
|
||||
|
||||
-- Lightline is a little tempermental about when you tell it to update it's
|
||||
-- theme, so we push it to vim's scheduler.
|
||||
-- vim.schedule(function()
|
||||
-- -- lightline#colorscheme() has a side effect of not always
|
||||
-- applying updates until after leaving insert mode.
|
||||
-- vim.fn['lightline#colorscheme']()
|
||||
|
||||
-- this will apply more uniforming across all modes, but may have
|
||||
-- unacceptable performance impacts.
|
||||
-- vim.fn['lightline#disable']()
|
||||
-- vim.fn['lightline#enable']()
|
||||
-- return our parsed theme for extension or use else where.
|
||||
--
|
||||
-- end)
|
||||
return theme
|
||||
|
||||
-- vi:nowrap
|
@ -0,0 +1,378 @@
|
||||
--
|
||||
-- Built with,
|
||||
--
|
||||
-- ,gggg,
|
||||
-- d8" "8I ,dPYb,
|
||||
-- 88 ,dP IP'`Yb
|
||||
-- 8888888P" I8 8I
|
||||
-- 88 I8 8'
|
||||
-- 88 gg gg ,g, I8 dPgg,
|
||||
-- ,aa,_88 I8 8I ,8'8, I8dP" "8I
|
||||
-- dP" "88P I8, ,8I ,8' Yb I8P I8
|
||||
-- Yb,_,d88b,,_ ,d8b, ,d8b,,8'_ 8) ,d8 I8,
|
||||
-- "Y8P" "Y888888P'"Y88P"`Y8P' "YY8P8P88P `Y8
|
||||
--
|
||||
|
||||
-- This is a starter colorscheme for use with Lush,
|
||||
-- for usage guides, see :h lush or :LushRunTutorial
|
||||
|
||||
--
|
||||
-- Note: Because this is lua file, vim will append your file to the runtime,
|
||||
-- which means you can require(...) it in other lua code (this is useful),
|
||||
-- but you should also take care not to conflict with other libraries.
|
||||
--
|
||||
-- (This is a lua quirk, as it has somewhat poor support for namespacing.)
|
||||
--
|
||||
-- Basically, name your file,
|
||||
--
|
||||
-- "super_theme/lua/lush_theme/super_theme_dark.lua",
|
||||
--
|
||||
-- not,
|
||||
--
|
||||
-- "super_theme/lua/dark.lua".
|
||||
--
|
||||
-- With that caveat out of the way...
|
||||
--
|
||||
|
||||
-- Enable lush.ify on this file, run:
|
||||
--
|
||||
-- `:Lushify`
|
||||
--
|
||||
-- or
|
||||
--
|
||||
-- `:lua require('lush').ify()`
|
||||
|
||||
local lush = require("lush")
|
||||
local hsl = lush.hsl
|
||||
|
||||
local theme = lush(function()
|
||||
local color1 = hsl("{color0}")
|
||||
local color2 = hsl("{color1}")
|
||||
local color3 = hsl("{color2}")
|
||||
local color4 = hsl("{color3}")
|
||||
local color5 = hsl("{color4}")
|
||||
local color6 = hsl("{color5}")
|
||||
local color7 = hsl("{color6}")
|
||||
local color8 = hsl("{color7}")
|
||||
local color9 = hsl("{color8}")
|
||||
local color10 = hsl("{color9}")
|
||||
local color11 = hsl("{color10}")
|
||||
local color12 = hsl("{color11}")
|
||||
local color13 = hsl("{color12}")
|
||||
local color14 = hsl("{color13}")
|
||||
local color15 = hsl("{color14}")
|
||||
local color16 = hsl("{color15}")
|
||||
|
||||
return {
|
||||
-- The following are all the Neovim default highlight groups from the docs
|
||||
-- as of 0.5.0-nightly-446, to aid your theme creation. Your themes should
|
||||
-- probably style all of these at a bare minimum.
|
||||
--
|
||||
-- Referenced/linked groups must come before being referenced/lined,
|
||||
-- so the order shown ((mostly) alphabetical) is likely
|
||||
-- not the order you will end up with.
|
||||
--
|
||||
-- You can uncomment these and leave them empty to disable any
|
||||
-- styling for that group (meaning they mostly get styled as Normal)
|
||||
-- or leave them commented to apply vims default colouring or linking.
|
||||
|
||||
Comment({ bg = color1, fg = color11.darken(70), gui = "italic" }), -- any comment
|
||||
ColorColumn({ bg = color1.darken(60) }), -- used for the columns set with 'colorcolumn'
|
||||
Conceal({ bg = color1, fg = color2.darken(60) }), -- placeholder characters substituted for concealed text (see 'conceallevel')
|
||||
Cursor({ bg = color1, fg = color9 }), -- character under the cursor
|
||||
lCursor({ bg = color3, fg = color10.darken(30) }), -- the character under the cursor when |language-mapping| is used (see 'guicursor')
|
||||
CursorIM({ bg = color6, fg = color1 }), -- like Cursor, but used when in IME mode |CursorIM|
|
||||
CursorColumn({ bg = color1, fg = color8 }), -- Screen-column at the cursor, when 'cursorcolumn' is set.
|
||||
CursorLine({ bg = color2.darken(40), fg = color2.lighten(40) }), -- Screen-line at the cursor, when 'cursorline' is set. Low-priority if foreground (ctermfg OR guifg) is not set.
|
||||
Directory({ bg = color1, fg = color6 }), -- directory names (and other special names in listings)
|
||||
DiffAdd({ bg = color1, fg = color6 }), -- diff mode: Added line |diff.txt|
|
||||
DiffChange({ bg = color1, fg = color11.lighten(30) }), -- diff mode: Changed line |diff.txt|
|
||||
DiffDelete({ bg = color1, fg = color5.lighten(30) }), -- diff mode: Deleted line |diff.txt|
|
||||
DiffText({ bg = color1, fg = color6.lighten(40) }), -- diff mode: Changed text within a changed line |diff.txt|
|
||||
EndOfBuffer({ bg = color1, fg = color2.darken(55) }), -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|.
|
||||
TermCursor({ bg = color6, fg = color1 }), -- cursor in a focused terminal
|
||||
TermCursorNC({ bg = color3, fg = color1 }), -- cursor in an unfocused terminal
|
||||
ErrorMsg({ bg = color3.lighten(50), fg = color1 }), -- error messages on the command line
|
||||
VertSplit({ bg = color4, fg = color2 }), -- the column separating vertically split windows
|
||||
Folded({ bg = color1, fg = color3.darken(30) }), -- line used for closed folds
|
||||
FoldColumn({ bg = color1, fg = color3 }), -- 'foldcolumn'
|
||||
SignColumn({ bg = color1, fg = color6 }), -- column where |signs| are displayed
|
||||
IncSearch({ bg = color8, fg = color1 }), -- 'incsearch' highlighting; also used for the text replaced with ":s///c"
|
||||
Substitute({ bg = color7, fg = color1 }), -- |:substitute| replacement text highlighting
|
||||
LineNr({ bg = color1, fg = color12 }), -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
|
||||
CursorLineNr({ bg = color12.lighten(35), fg = color1.darken(30) }), -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
|
||||
MatchParen({ bg = color1, fg = color1.lighten(50) }), -- The character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt|
|
||||
ModeMsg({ bg = color1.lighten(10), fg = color6 }), -- 'showmode' message (e.g., "-- INSERT -- ")
|
||||
MsgArea({ bg = color1.lighten(5), fg = color6.darken(15) }), -- Area for messages and cmdline
|
||||
MsgSeparator({ bg = color1.darken(80), fg = color5.lighten(60) }), -- Separator for scrolled messages, `msgsep` flag of 'display'
|
||||
MoreMsg({ bg = color1, fg = color6.lighten(10), gui = "italic" }), -- |more-prompt|
|
||||
NonText({ bg = color1, fg = color2.darken(30), ctermbg = none }), -- '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|.
|
||||
Normal({ bg = color1, fg = color1.lighten(40), ctermbg = none }), -- normal text
|
||||
NormalFloat({ bg = color7, fg = color2.darken(40) }), -- Normal text in floating windows.
|
||||
NormalNC({ bg = color1, fg = color9.darken(70) }), -- normal text in non-current windows
|
||||
Pmenu({ bg = color1.lighten(30), fg = color8 }), -- Popup menu: normal item.
|
||||
PmenuSel({ bg = color5.lighten(30), fg = color12 }), -- Popup menu: selected item.
|
||||
PmenuSbar({ bg = color2, fg = color1 }), -- Popup menu: scrollbar.
|
||||
PmenuThumb({ bg = color1, fg = color2 }), -- Popup menu: Thumb of the scrollbar.
|
||||
Question({ bg = color1, fg = color5.lighten(30) }), -- |hit-enter| prompt and yes/no questions
|
||||
QuickFixLine({ bg = color3, fg = color9 }), -- Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there.
|
||||
Search({ bg = color8.darken(20), fg = color2.lighten(10) }), -- Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand out.
|
||||
SpecialKey({ bg = color1, fg = color8.darken(40) }), -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace|
|
||||
SpellBad({ bg = color1, fg = color3.darken(25), gui = "undercurl" }), -- Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise.
|
||||
SpellCap({ SpellBad }), -- Word that should start with a capital. |spell| Combined with the highlighting used otherwise.
|
||||
SpellLocal({ SpellBad }), -- Word that is recognized by the spellchecker as one that is used in another region. |spell| Combined with the highlighting used otherwise.
|
||||
SpellRare({ SpellBad }), -- Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise.
|
||||
StatusLine({ bg = color1.lighten(60), fg = color6.darken(60) }), -- status line of current window
|
||||
StatusLineNC({ bg = color9.darken(70), fg = color2.lighten(10) }), -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window.
|
||||
TabLine({ StatusLineNC }), -- tab pages line, not active tab page label
|
||||
TabLineFill({ PmenuThumb }), -- tab pages line, where there are no labels
|
||||
TabLineSel({ Search }), -- tab pages line, active tab page label
|
||||
Title({ bg = color1.lighten(10), fg = color1.lighten(40) }), -- titles for output from ":set all", ":autocmd" etc.
|
||||
Visual({ bg = color9, fg = color1 }), -- Visual mode selection
|
||||
VisualNOS({ QuickFixLine }), -- Visual mode selection when vim is "Not Owning the Selection".
|
||||
WarningMsg({ bg = color1.lighten(15), fg = color6.lighten(70), gui = "bold" }), -- warning messages
|
||||
Whitespace({ NonText }), -- "nbsp", "space", "tab" and "trail" in 'listchars'
|
||||
WildMenu({ PmenuSel }), -- current match in 'wildmenu' completion
|
||||
|
||||
-- These groups are not listed as default vim groups,
|
||||
-- but they are defacto standard group names for syntax highlighting.
|
||||
-- commented out groups should chain up to their "preferred" group by
|
||||
-- default,
|
||||
-- Uncomment and edit if you want more specific syntax highlighting.
|
||||
|
||||
Constant({ bg = color1, fg = color8.darken(35) }), -- (preferred) any constant
|
||||
-- String { }, -- a string constant: "this is a string"
|
||||
-- Character { }, -- a character constant: 'c', '\n'
|
||||
-- Number { }, -- a number constant: 234, 0xff
|
||||
-- Boolean { }, -- a boolean constant: TRUE, false
|
||||
-- Float { }, -- a floating point constant: 2.3e10
|
||||
|
||||
Identifier({ bg = color1, fg = color5.darken(30) }), -- (preferred) any variable name
|
||||
Function({ bg = color1, fg = color1.lighten(30) }), -- function name (also: methods for classes)
|
||||
|
||||
Statement({ bg = color1, fg = color4.lighten(40) }), -- (preferred) any statement
|
||||
Conditional({ bg = color1, fg = color4.lighten(30) }), -- if, then, else, endif, switch, etc.
|
||||
Repeat({ bg = color1, fg = color3.darken(20) }), -- for, do, while, etc.
|
||||
Label({ bg = color1, fg = color2.lighten(30) }), -- case, default, etc.
|
||||
-- Operator { }, -- "sizeof", "+", "*", etc.
|
||||
-- Keyword { }, -- any other keyword
|
||||
-- Exception { }, -- try, catch, throw
|
||||
|
||||
PreProc({ bg = color1, fg = color7.darken(30) }), -- (preferred) generic Preprocessor
|
||||
-- Include { }, -- preprocessor #include
|
||||
-- Define { }, -- preprocessor #define
|
||||
-- Macro { }, -- same as Define
|
||||
-- PreCondit { }, -- preprocessor #if, #else, #endif, etc.
|
||||
|
||||
Type({ bg = color1, fg = color1.lighten(70), gui = "bold" }), -- (preferred) int, long, char, etc.
|
||||
-- StorageClass { }, -- static, register, volatile, etc.
|
||||
-- Structure { }, -- struct, union, enum, etc.
|
||||
-- Typedef { }, -- A typedef
|
||||
|
||||
Special({ bg = color1, fg = color6.darken(50) }), -- (preferred) any special symbol
|
||||
-- SpecialChar { }, -- special character in a constant
|
||||
-- Tag { }, -- you can use CTRL-] on this
|
||||
-- Delimiter { }, -- character that needs attention
|
||||
-- SpecialComment { }, -- special things inside a comment
|
||||
-- Debug { }, -- debugging statements
|
||||
|
||||
Underlined({ gui = "underline" }), -- (preferred) text that stands out, HTML links
|
||||
Bold({ gui = "bold" }),
|
||||
Italic({ gui = "italic" }),
|
||||
|
||||
-- ("Ignore", below, may be invisible...)
|
||||
-- Ignore { }, -- (preferred) left blank, hidden |hl-Ignore|
|
||||
|
||||
Error({ bg = color6.darken(70), fg = color11.lighten(50), gui = "bold" }), -- (preferred) any erroneous construct
|
||||
|
||||
Todo({ Title }), -- (preferred) anything that needs extra attention; mostly the keywords TODO FIXME and XXX
|
||||
|
||||
-- These groups are for the native LSP client. Some other LSP clients may
|
||||
-- use these groups, or use their own. Consult your LSP client's
|
||||
-- documentation.
|
||||
|
||||
-- LspReferenceText { }, -- used for highlighting "text" references
|
||||
-- LspReferenceRead { }, -- used for highlighting "read" references
|
||||
-- LspReferenceWrite { }, -- used for highlighting "write" references
|
||||
|
||||
-- LspDiagnosticsDefaultError { }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
|
||||
-- LspDiagnosticsDefaultWarning { }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
|
||||
-- LspDiagnosticsDefaultInformation { }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
|
||||
-- LspDiagnosticsDefaultHint { }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
|
||||
|
||||
-- LspDiagnosticsVirtualTextError { }, -- Used for "Error" diagnostic virtual text
|
||||
-- LspDiagnosticsVirtualTextWarning { }, -- Used for "Warning" diagnostic virtual text
|
||||
-- LspDiagnosticsVirtualTextInformation { }, -- Used for "Information" diagnostic virtual text
|
||||
-- LspDiagnosticsVirtualTextHint { }, -- Used for "Hint" diagnostic virtual text
|
||||
|
||||
-- LspDiagnosticsUnderlineError { }, -- Used to underline "Error" diagnostics
|
||||
-- LspDiagnosticsUnderlineWarning { }, -- Used to underline "Warning" diagnostics
|
||||
-- LspDiagnosticsUnderlineInformation { }, -- Used to underline "Information" diagnostics
|
||||
-- LspDiagnosticsUnderlineHint { }, -- Used to underline "Hint" diagnostics
|
||||
|
||||
-- LspDiagnosticsFloatingError { }, -- Used to color "Error" diagnostic messages in diagnostics float
|
||||
-- LspDiagnosticsFloatingWarning { }, -- Used to color "Warning" diagnostic messages in diagnostics float
|
||||
-- LspDiagnosticsFloatingInformation { }, -- Used to color "Information" diagnostic messages in diagnostics float
|
||||
-- LspDiagnosticsFloatingHint { }, -- Used to color "Hint" diagnostic messages in diagnostics float
|
||||
|
||||
-- LspDiagnosticsSignError { }, -- Used for "Error" signs in sign column
|
||||
-- LspDiagnosticsSignWarning { }, -- Used for "Warning" signs in sign column
|
||||
-- LspDiagnosticsSignInformation { }, -- Used for "Information" signs in sign column
|
||||
-- LspDiagnosticsSignHint { }, -- Used for "Hint" signs in sign column
|
||||
|
||||
-- These groups are for the neovim tree-sitter highlights.
|
||||
-- As of writing, tree-sitter support is a WIP, group names may change.
|
||||
-- By default, most of these groups link to an appropriate Vim group,
|
||||
-- TSError -> Error for example, so you do not have to define these unless
|
||||
-- you explicitly want to support Treesitter's improved syntax awareness.
|
||||
|
||||
-- TSAnnotation { }; -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information.
|
||||
-- TSAttribute { }; -- (unstable) TODO: docs
|
||||
-- TSBoolean { }; -- For booleans.
|
||||
-- TSCharacter { }; -- For characters.
|
||||
-- TSComment { }; -- For comment blocks.
|
||||
-- TSConstructor { }; -- For constructor calls and definitions: ` { }` in Lua, and Java constructors.
|
||||
-- TSConditional { }; -- For keywords related to conditionnals.
|
||||
-- TSConstant { }; -- For constants
|
||||
-- TSConstBuiltin { }; -- For constant that are built in the language: `nil` in Lua.
|
||||
-- TSConstMacro { }; -- For constants that are defined by macros: `NULL` in C.
|
||||
-- TSError { }; -- For syntax/parser errors.
|
||||
-- TSException { }; -- For exception related keywords.
|
||||
-- TSField { }; -- For fields.
|
||||
-- TSFloat { }; -- For floats.
|
||||
-- TSFunction { }; -- For function (calls and definitions).
|
||||
-- TSFuncBuiltin { }; -- For builtin functions: `table.insert` in Lua.
|
||||
-- TSFuncMacro { }; -- For macro defined fuctions (calls and definitions): each `macro_rules` in Rust.
|
||||
-- TSInclude { }; -- For includes: `#include` in C, `use` or `extern crate` in Rust, or `require` in Lua.
|
||||
-- TSKeyword { }; -- For keywords that don't fall in previous categories.
|
||||
-- TSKeywordFunction { }; -- For keywords used to define a fuction.
|
||||
-- TSLabel { }; -- For labels: `label:` in C and `:label:` in Lua.
|
||||
-- TSMethod { }; -- For method calls and definitions.
|
||||
-- TSNamespace { }; -- For identifiers referring to modules and namespaces.
|
||||
-- TSNone { }; -- TODO: docs
|
||||
-- TSNumber { }; -- For all numbers
|
||||
-- TSOperator { }; -- For any operator: `+`, but also `->` and `*` in C.
|
||||
-- TSParameter { }; -- For parameters of a function.
|
||||
-- TSParameterReference { }; -- For references to parameters of a function.
|
||||
-- TSProperty { }; -- Same as `TSField`.
|
||||
-- TSPunctDelimiter { }; -- For delimiters ie: `.`
|
||||
-- TSPunctBracket { }; -- For brackets and parens.
|
||||
-- TSPunctSpecial { }; -- For special punctutation that does not fall in the catagories before.
|
||||
-- TSRepeat { }; -- For keywords related to loops.
|
||||
-- TSString { }; -- For strings.
|
||||
-- TSStringRegex { }; -- For regexes.
|
||||
-- TSStringEscape { }; -- For escape characters within a string.
|
||||
-- TSSymbol { }; -- For identifiers referring to symbols or atoms.
|
||||
-- TSType { }; -- For types.
|
||||
-- TSTypeBuiltin { }; -- For builtin types.
|
||||
-- TSVariable { }; -- Any variable name that does not have another highlight.
|
||||
-- TSVariableBuiltin { }; -- Variable names that are defined by the languages, like `this` or `self`.
|
||||
|
||||
-- TSTag { }; -- Tags like html tag names.
|
||||
-- TSTagDelimiter { }; -- Tag delimiter like `<` `>` `/`
|
||||
-- TSText { }; -- For strings considered text in a markup language.
|
||||
-- TSEmphasis { }; -- For text to be represented with emphasis.
|
||||
-- TSUnderline { }; -- For text to be represented with an underline.
|
||||
-- TSStrike { }; -- For strikethrough text.
|
||||
-- TSTitle { }; -- Text that is part of a title.
|
||||
-- TSLiteral { }; -- Literal text.
|
||||
-- TSURI { }; -- Any URI like a link or email.
|
||||
}
|
||||
end)
|
||||
|
||||
-- Define your lightline theme using groups from our lush spec
|
||||
--
|
||||
-- This theme simply flips the background and foreground colours
|
||||
-- for normal and insert mode.
|
||||
--
|
||||
-- Continue below to see how to enable real time updating,
|
||||
-- then try editing this theme.
|
||||
local lightline_theme = {
|
||||
normal = {
|
||||
left = {
|
||||
{ theme.CursorLineNr.fg.hex, theme.CursorLineNr.bg.hex },
|
||||
},
|
||||
middle = {
|
||||
{ theme.Normal.fg.hex, theme.Normal.bg.hex },
|
||||
},
|
||||
right = {
|
||||
{ theme.StatusLine.fg.hex, theme.StatusLine.bg.hex },
|
||||
},
|
||||
},
|
||||
insert = {
|
||||
left = {
|
||||
{ theme.PmenuSbar.bg.hex, theme.PmenuSbar.fg.hex },
|
||||
},
|
||||
middle = {
|
||||
{ theme.Normal.bg.hex, theme.Normal.fg.hex },
|
||||
},
|
||||
right = {
|
||||
{ theme.StatusLine.bg.hex, theme.StatusLine.fg.hex },
|
||||
},
|
||||
},
|
||||
replace = {
|
||||
left = {
|
||||
{ theme.Pmenu.bg.hex, theme.Pmenu.fg.hex },
|
||||
},
|
||||
middle = {
|
||||
{ theme.Normal.bg.hex, theme.Normal.fg.hex },
|
||||
},
|
||||
right = {
|
||||
{ theme.StatusLine.bg.hex, theme.StatusLine.fg.hex },
|
||||
},
|
||||
},
|
||||
visual = {
|
||||
left = {
|
||||
{ theme.WarningMsg.bg.hex, theme.WarningMsg.fg.hex },
|
||||
},
|
||||
middle = {
|
||||
{ theme.Normal.bg.hex, theme.Normal.fg.hex },
|
||||
},
|
||||
right = {
|
||||
{ theme.StatusLine.bg.hex, theme.StatusLine.fg.hex },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Use lightlines helper functions to correct cterm holes in our theme.
|
||||
-- Note: These functions can be expensive to run, it is recommended you
|
||||
-- leave them commented out until you wish to work on lightline,
|
||||
-- or investigate the two-file approach in the other lightline example.
|
||||
local lightline_theme_filled = vim.fn["lightline#colorscheme#fill"](lightline_theme)
|
||||
|
||||
-- define our theme for lightline to find
|
||||
vim.g["lightline#colorscheme#lightline_one_file#palette"] = lightline_theme_filled
|
||||
|
||||
-- Technically, that's all you have to do for your lightline theme to
|
||||
-- be applied but if you want real-time feedback while designing it, you must
|
||||
-- include some extra code which forces lightline to notice the changes.
|
||||
--
|
||||
-- It's recommended you comment out the following code if you're not actively
|
||||
-- editing your lightline theme.
|
||||
--
|
||||
-- You may find realtime performance unacceptable while changes are being
|
||||
-- propagated back to and applied by vimscript, if this is a problem,
|
||||
-- you can disable lush.ify() on the buffer (save then `:e!`), then when you
|
||||
-- wish to preview your changes, save and run `:luafile %`.
|
||||
--
|
||||
-- Consider making a temporary mapping while working:
|
||||
--
|
||||
-- `:nmap <leader>llr :luafile %<CR>`
|
||||
|
||||
-- Lightline is a little tempermental about when you tell it to update it's
|
||||
-- theme, so we push it to vim's scheduler.
|
||||
-- vim.schedule(function()
|
||||
-- -- lightline#colorscheme() has a side effect of not always
|
||||
-- applying updates until after leaving insert mode.
|
||||
-- vim.fn['lightline#colorscheme']()
|
||||
|
||||
-- this will apply more uniforming across all modes, but may have
|
||||
-- unacceptable performance impacts.
|
||||
-- vim.fn['lightline#disable']()
|
||||
-- vim.fn['lightline#enable']()
|
||||
-- return our parsed theme for extension or use else where.
|
||||
--
|
||||
-- end)
|
||||
return theme
|
||||
|
||||
-- vi:nowrapD
|
@ -0,0 +1,22 @@
|
||||
require("bufferline").setup({
|
||||
options = {
|
||||
themable = true,
|
||||
offsets = { { filetype = "NvimTree", text = "", padding = 1 } },
|
||||
buffer_close_icon = "",
|
||||
modified_icon = "",
|
||||
close_icon = "",
|
||||
close_command = "lua require('uno.myFuncs').closeBuffer()",
|
||||
left_trunc_marker = "",
|
||||
right_trunc_marker = "",
|
||||
max_name_length = 14,
|
||||
max_prefix_length = 13,
|
||||
tab_size = 20,
|
||||
show_tab_indicators = true,
|
||||
enforce_regular_tabs = false,
|
||||
view = "multiwindow",
|
||||
show_buffer_close_icons = true,
|
||||
separator_style = "thin",
|
||||
-- mappings = "true",
|
||||
diagnostics = "nvim_lsp",
|
||||
},
|
||||
})
|
@ -0,0 +1,10 @@
|
||||
require("colorizer").setup({ "*" }, {
|
||||
RGB = true, -- #RGB hex codes
|
||||
RRGGBB = true, -- #RRGGBB hex codes
|
||||
names = true, -- "Name" codes like Blue
|
||||
RRGGBBAA = true, -- #RRGGBBAA hex codes
|
||||
rgb_fn = true, -- CSS rgb() and rgba() functions
|
||||
hsl_fn = true, -- CSS hsl() and hsla() functions
|
||||
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
||||
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
||||
})
|
@ -0,0 +1,8 @@
|
||||
vim.cmd([[
|
||||
|
||||
|
||||
hi Normal ctermbg=none guibg=none
|
||||
hi ColorColumn ctermbg=4 guibg=#4d0000
|
||||
hi VertSplit guibg=bg guifg=bg
|
||||
|
||||
]])
|
@ -0,0 +1,51 @@
|
||||
require("Comment").setup({
|
||||
---Add a space b/w comment and the line
|
||||
---@type boolean
|
||||
padding = true,
|
||||
---Lines to be ignored while comment/uncomment.
|
||||
---Could be a regex string or a function that returns a regex string.
|
||||
---Example: Use '^$' to ignore empty lines
|
||||
---@type string|function
|
||||
ignore = nil,
|
||||
---Create basic (operator-pending) and extended mappings for NORMAL + VISUAL mode
|
||||
---@type table
|
||||
mappings = {
|
||||
---operator-pending mapping
|
||||
---Includes `gcc`, `gcb`, `gc[count]{motion}` and `gb[count]{motion}`
|
||||
basic = true,
|
||||
---extra mapping
|
||||
---Includes `gco`, `gcO`, `gcA`
|
||||
extra = true,
|
||||
---extended mapping
|
||||
---Includes `g>`, `g<`, `g>[count]{motion}` and `g<[count]{motion}`
|
||||
extended = false,
|
||||
},
|
||||
---LHS of toggle mapping in NORMAL + VISUAL mode
|
||||
---@type table
|
||||
toggler = {
|
||||
---line-comment keymap
|
||||
line = "gcc",
|
||||
---block-comment keymap
|
||||
block = "gbc",
|
||||
},
|
||||
---LHS of operator-pending mapping in NORMAL + VISUAL mode
|
||||
---@type table
|
||||
opleader = {
|
||||
---line-comment keymap
|
||||
line = "gc",
|
||||
---block-comment keymap
|
||||
block = "gb",
|
||||
},
|
||||
---Pre-hook, called before commenting the line
|
||||
---@type function|nil
|
||||
---@param ctx Ctx
|
||||
pre_hook = function(ctx)
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring()
|
||||
end,
|
||||
---Post-hook, called after commenting is done
|
||||
---@type function|nil
|
||||
post_hook = nil,
|
||||
})
|
||||
|
||||
local comment_ft = require("Comment.ft")
|
||||
comment_ft.set("lua", { "--%s", "--[[%s]]" })
|
@ -0,0 +1,93 @@
|
||||
-- Global Options
|
||||
-- vim.go.guicursor = "block"
|
||||
vim.go.termguicolors = true
|
||||
vim.go.hlsearch = false
|
||||
vim.go.hidden = true
|
||||
vim.go.errorbells = false
|
||||
vim.go.ignorecase = true
|
||||
vim.go.smartcase = true
|
||||
vim.go.scrolloff = 12
|
||||
vim.go.sidescrolloff = 21
|
||||
-- vim.go.completeopt = "menuone,noinsert,preview"
|
||||
vim.go.completeopt = "menuone,noselect"
|
||||
vim.go.cmdheight = 2
|
||||
vim.go.mouse = "a"
|
||||
vim.go.clipboard = "unnamedplus"
|
||||
vim.go.wildmenu = true
|
||||
vim.go.wildmode = "longest,list,full"
|
||||
vim.go.undodir = os.getenv("HOME") .. "/.nvim/undodir"
|
||||
vim.go.backupdir = os.getenv("HOME") .. "/.nvim/backups"
|
||||
vim.go.backup = true
|
||||
vim.go.updatetime = 100
|
||||
vim.go.fillchars = "eob: "
|
||||
vim.go.laststatus = 3
|
||||
vim.go.splitright = true
|
||||
vim.go.splitbelow = false
|
||||
vim.go.mousemodel = "extend"
|
||||
|
||||
-- Window Options
|
||||
vim.wo.relativenumber = true
|
||||
vim.wo.nu = true
|
||||
vim.wo.wrap = false
|
||||
vim.wo.colorcolumn = "80"
|
||||
vim.wo.signcolumn = "yes"
|
||||
vim.wo.foldcolumn = "2"
|
||||
|
||||
-- Buffer Options
|
||||
vim.bo.tabstop = 2
|
||||
vim.bo.softtabstop = 2
|
||||
vim.bo.shiftwidth = 2
|
||||
vim.bo.expandtab = true
|
||||
vim.bo.smartindent = true
|
||||
vim.bo.autoindent = true
|
||||
vim.bo.swapfile = true
|
||||
vim.bo.undofile = true
|
||||
|
||||
-- Global Variables
|
||||
vim.g.mapleader = " "
|
||||
vim.g.python3_host_prog = "/usr/bin/python3"
|
||||
vim.g.mkdp_browser = "/usr/bin/" .. vim.fn.expand("$BROWSER")
|
||||
-- vim.g.colorizer_auto_color = 1 -- might not be needed
|
||||
|
||||
vim.opt.wildignore = {
|
||||
"*.pyc",
|
||||
"*_build/*",
|
||||
"**/coverage/*",
|
||||
"**/node_modules/*",
|
||||
"**/android/*",
|
||||
"**/ios/*",
|
||||
"**/.git/*",
|
||||
}
|
||||
|
||||
local _term = vim.api.nvim_create_augroup("Terminal", { clear = true })
|
||||
vim.api.nvim_create_autocmd("TermOpen", {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
vim.wo.relativenumber = false
|
||||
vim.wo.number = false
|
||||
vim.cmd("startinsert")
|
||||
end,
|
||||
group = _term,
|
||||
})
|
||||
|
||||
local _ft = vim.api.nvim_create_augroup("FileTypeSettings", { clear = true })
|
||||
-- Lua
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "lua",
|
||||
callback = function()
|
||||
vim.bo.tabstop = 2
|
||||
vim.bo.shiftwidth = 2
|
||||
end,
|
||||
group = _ft,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "sh",
|
||||
callback = function()
|
||||
vim.bo.tabstop = 2
|
||||
vim.bo.shiftwidth = 2
|
||||
end,
|
||||
group = _ft,
|
||||
})
|
||||
|
||||
vim.cmd("syntax on")
|
||||
vim.cmd([[colorscheme gruvbox]])
|
@ -0,0 +1,119 @@
|
||||
local cb = require("diffview.config").diffview_callback
|
||||
require("diffview").setup({
|
||||
diff_binaries = false, -- Show diffs for binaries
|
||||
enhanced_diff_hl = false, -- See ':h diffview-config-enhanced_diff_hl'
|
||||
use_icons = true, -- Requires nvim-web-devicons
|
||||
icons = {
|
||||
-- Only applies when use_icons is true.
|
||||
folder_closed = "",
|
||||
folder_open = "",
|
||||
},
|
||||
signs = {
|
||||
fold_closed = "",
|
||||
fold_open = "",
|
||||
},
|
||||
file_panel = {
|
||||
with_config = {
|
||||
position = "left", -- One of 'left', 'right', 'top', 'bottom'
|
||||
width = 35, -- Only applies when position is 'left' or 'right'
|
||||
height = 10, -- Only applies when position is 'top' or 'bottom'
|
||||
},
|
||||
listing_style = "tree", -- One of 'list' or 'tree'
|
||||
tree_options = {
|
||||
-- Only applies when listing_style is 'tree'
|
||||
flatten_dirs = true,
|
||||
folder_statuses = "always", -- One of 'never', 'only_folded' or 'always'.
|
||||
},
|
||||
},
|
||||
file_history_panel = {
|
||||
with_config = {
|
||||
position = "bottom",
|
||||
width = 35,
|
||||
height = 16,
|
||||
},
|
||||
log_options = {
|
||||
single_file = {
|
||||
max_count = 512, -- Limit the number of commits
|
||||
follow = true, -- Follow renames (only for single file)
|
||||
all = false, -- Include all refs under 'refs/' including HEAD
|
||||
merges = false, -- List only merge commits
|
||||
no_merges = false, -- List no merge commits
|
||||
reverse = false, -- List commits in reverse order
|
||||
},
|
||||
multi_file = {
|
||||
max_count = 128, -- Limit the number of commits
|
||||
all = false, -- Include all refs under 'refs/' including HEAD
|
||||
merges = false, -- List only merge commits
|
||||
no_merges = false, -- List no merge commits
|
||||
reverse = false, -- List commits in reverse order
|
||||
},
|
||||
},
|
||||
},
|
||||
default_args = {
|
||||
-- Default args prepended to the arg-list for the listed commands
|
||||
DiffviewOpen = {},
|
||||
DiffviewFileHistory = {},
|
||||
},
|
||||
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
|
||||
["gf"] = cb("goto_file"), -- Open the file in a new split in previous tabpage
|
||||
["<C-w><C-f>"] = cb("goto_file_split"), -- Open the file in a new split
|
||||
["<C-w>gf"] = cb("goto_file_tab"), -- Open the file in a new tabpage
|
||||
["<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.
|
||||
["X"] = cb("restore_entry"), -- Restore entry to the state on the left side.
|
||||
["R"] = cb("refresh_files"), -- Update stats and entries in the file list.
|
||||
["<tab>"] = cb("select_next_entry"),
|
||||
["<s-tab>"] = cb("select_prev_entry"),
|
||||
["gf"] = cb("goto_file"),
|
||||
["<C-w><C-f>"] = cb("goto_file_split"),
|
||||
["<C-w>gf"] = cb("goto_file_tab"),
|
||||
["i"] = cb("listing_style"), -- Toggle between 'list' and 'tree' views
|
||||
["f"] = cb("toggle_flatten_dirs"), -- Flatten empty subdirectories in tree listing style.
|
||||
["<leader>e"] = cb("focus_files"),
|
||||
["<leader>b"] = cb("toggle_files"),
|
||||
},
|
||||
file_history_panel = {
|
||||
["g!"] = cb("options"), -- Open the option panel
|
||||
["<C-A-d>"] = cb("open_in_diffview"), -- Open the entry under the cursor in a diffview
|
||||
["y"] = cb("copy_hash"), -- Copy the commit hash of the entry under the cursor
|
||||
["zR"] = cb("open_all_folds"),
|
||||
["zM"] = cb("close_all_folds"),
|
||||
["j"] = cb("next_entry"),
|
||||
["<down>"] = cb("next_entry"),
|
||||
["k"] = cb("prev_entry"),
|
||||
["<up>"] = cb("prev_entry"),
|
||||
["<cr>"] = cb("select_entry"),
|
||||
["o"] = cb("select_entry"),
|
||||
["<2-LeftMouse>"] = cb("select_entry"),
|
||||
["<tab>"] = cb("select_next_entry"),
|
||||
["<s-tab>"] = cb("select_prev_entry"),
|
||||
["gf"] = cb("goto_file"),
|
||||
["<C-w><C-f>"] = cb("goto_file_split"),
|
||||
["<C-w>gf"] = cb("goto_file_tab"),
|
||||
["<leader>e"] = cb("focus_files"),
|
||||
["<leader>b"] = cb("toggle_files"),
|
||||
},
|
||||
option_panel = {
|
||||
["<tab>"] = cb("select"),
|
||||
["q"] = cb("close"),
|
||||
},
|
||||
},
|
||||
})
|
@ -0,0 +1,86 @@
|
||||
require("dressing").setup({
|
||||
input = {
|
||||
-- Default prompt string
|
||||
default_prompt = "➤ ",
|
||||
-- When true, <Esc> will close the modal
|
||||
insert_only = true,
|
||||
-- These are passed to nvim_open_win
|
||||
anchor = "SW",
|
||||
relative = "cursor",
|
||||
border = "rounded",
|
||||
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
|
||||
prefer_width = 40,
|
||||
max_width = nil,
|
||||
min_width = 20,
|
||||
-- Window transparency (0-100)
|
||||
winblend = 10,
|
||||
-- see :help dressing_get_config
|
||||
get_config = nil,
|
||||
},
|
||||
select = {
|
||||
-- Priority list of preferred vim.select implementations
|
||||
backend = { "telescope", "nui", "fzf", "builtin" },
|
||||
-- Options for telescope selector
|
||||
-- telescope = {
|
||||
-- -- can be 'dropdown', 'cursor', or 'ivy'
|
||||
-- theme = "dropdown"
|
||||
-- },
|
||||
-- -- Options for fzf selector
|
||||
fzf = {
|
||||
window = {
|
||||
width = 0.5,
|
||||
height = 0.4,
|
||||
},
|
||||
},
|
||||
-- Options for nui Menu
|
||||
nui = {
|
||||
-- position = {
|
||||
-- row = 1,
|
||||
-- col = 0
|
||||
-- },
|
||||
size = nil,
|
||||
relative = "cursor",
|
||||
border = {
|
||||
style = "rounded",
|
||||
highlight = "NightflyRed",
|
||||
text = {
|
||||
top_align = "right",
|
||||
},
|
||||
},
|
||||
max_width = 80,
|
||||
max_height = 40,
|
||||
},
|
||||
-- Options for built-in selector
|
||||
builtin = {
|
||||
-- These are passed to nvim_open_win
|
||||
anchor = "NW",
|
||||
relative = "cursor",
|
||||
-- row = 0,
|
||||
-- col = 0,
|
||||
border = "rounded",
|
||||
-- Window transparency (0-100)
|
||||
winblend = 10,
|
||||
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
|
||||
width = nil,
|
||||
max_width = 0.8,
|
||||
min_width = 40,
|
||||
height = nil,
|
||||
max_height = 0.9,
|
||||
min_height = 10,
|
||||
},
|
||||
-- Used to override format_item. See :help dressing-format
|
||||
format_item_override = {},
|
||||
-- see :help dressing_get_config
|
||||
get_config = function(opts)
|
||||
if opts.kind == "codeaction" then
|
||||
return {
|
||||
backend = "nui",
|
||||
nui = {
|
||||
relative = "cursor",
|
||||
max_width = 80,
|
||||
},
|
||||
}
|
||||
end
|
||||
end,
|
||||
},
|
||||
})
|
@ -0,0 +1,204 @@
|
||||
-- Mappings for nvimtree
|
||||
vim.api.nvim_set_keymap("n", "<C-n>", ":NvimTreeToggle<CR>", {
|
||||
noremap = true,
|
||||
silent = true,
|
||||
})
|
||||
|
||||
local lib = require("nvim-tree.lib")
|
||||
local view = require("nvim-tree.view")
|
||||
|
||||
local function collapse_all()
|
||||
require("nvim-tree.actions.collapse-all").fn()
|
||||
end
|
||||
|
||||
local function edit_or_open()
|
||||
-- open as vsplit on current node
|
||||
local action = "edit"
|
||||
local node = lib.get_node_at_cursor()
|
||||
|
||||
-- Just copy what's done normally with vsplit
|
||||
if node.link_to and not node.nodes then
|
||||
require("nvim-tree.actions.open-file").fn(action, node.link_to)
|
||||
view.close() -- Close the tree if file was opened
|
||||
elseif node.nodes ~= nil then
|
||||
lib.expand_or_collapse(node)
|
||||
else
|
||||
require("nvim-tree.actions.open-file").fn(action, node.absolute_path)
|
||||
view.close() -- Close the tree if file was opened
|
||||
end
|
||||
end
|
||||
|
||||
local function vsplit_preview()
|
||||
-- open as vsplit on current node
|
||||
local action = "vsplit"
|
||||
local node = lib.get_node_at_cursor()
|
||||
|
||||
-- Just copy what's done normally with vsplit
|
||||
if node.link_to and not node.nodes then
|
||||
require("nvim-tree.actions.open-file").fn(action, node.link_to)
|
||||
elseif node.nodes ~= nil then
|
||||
lib.expand_or_collapse(node)
|
||||
else
|
||||
require("nvim-tree.actions.open-file").fn(action, node.absolute_path)
|
||||
end
|
||||
|
||||
-- Finally refocus on tree if it was lost
|
||||
view.focus(0)
|
||||
end
|
||||
|
||||
local tree_cb = require("nvim-tree.config").nvim_tree_callback
|
||||
|
||||
require("nvim-tree").setup({
|
||||
respect_buf_cwd = true,
|
||||
disable_netrw = true,
|
||||
hijack_netrw = true,
|
||||
ignore_ft_on_setup = {},
|
||||
open_on_setup = false,
|
||||
-- auto_close = false,
|
||||
open_on_tab = false,
|
||||
hijack_cursor = false,
|
||||
update_cwd = true,
|
||||
sync_root_with_cwd = false,
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
icons = {
|
||||
hint = "",
|
||||
info = "",
|
||||
warning = "",
|
||||
error = "",
|
||||
},
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_root = true,
|
||||
ignore_list = { ".git", "node_modules", ".cache" },
|
||||
},
|
||||
system_open = {
|
||||
cmd = nil,
|
||||
args = {},
|
||||
},
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
custom = { "node_modules", "^\\.cache", "^\\.vim", "^\\.nvim", "^\\.zcompdump" },
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = false,
|
||||
timeout = 400,
|
||||
},
|
||||
actions = {
|
||||
use_system_clipboard = true,
|
||||
change_dir = {
|
||||
enable = true,
|
||||
global = false,
|
||||
restrict_above_cwd = false,
|
||||
},
|
||||
expand_all = {
|
||||
max_folder_discovery = 300,
|
||||
},
|
||||
open_file = {
|
||||
quit_on_open = true,
|
||||
resize_window = true,
|
||||
window_picker = {
|
||||
enable = true,
|
||||
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
|
||||
exclude = {
|
||||
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
|
||||
buftype = { "nofile", "terminal", "help" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
renderer = {
|
||||
highlight_git = false,
|
||||
root_folder_modifier = ":t",
|
||||
special_files = {},
|
||||
icons = {
|
||||
webdev_colors = true,
|
||||
git_placement = "before",
|
||||
padding = " ",
|
||||
symlink_arrow = " ➛ ",
|
||||
show = {
|
||||
git = true,
|
||||
folder = true,
|
||||
file = true,
|
||||
folder_arrow = true,
|
||||
},
|
||||
glyphs = {
|
||||
default = " ",
|
||||
symlink = " ",
|
||||
git = {
|
||||
unstaged = "✗",
|
||||
staged = "✓",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
untracked = "★",
|
||||
deleted = "",
|
||||
ignored = "◌",
|
||||
},
|
||||
folder = {
|
||||
-- disable indent_markers option to get arrows working or if you want both arrows and indent then just add the arrow icons in front ofthe default and opened folders below!
|
||||
arrow_open = "",
|
||||
arrow_closed = "",
|
||||
default = "",
|
||||
open = "",
|
||||
empty = "",
|
||||
empty_open = "",
|
||||
symlink = "",
|
||||
symlink_open = "",
|
||||
},
|
||||
},
|
||||
},
|
||||
indent_markers = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
view = {
|
||||
width = 35,
|
||||
-- height = 30,
|
||||
hide_root_folder = false,
|
||||
side = "left",
|
||||
mappings = {
|
||||
custom_only = false,
|
||||
list = {
|
||||
-- {key = {"<CR>", "o", "<2-LeftMouse>"}, cb = tree_cb("edit")},
|
||||
{ key = { "<C-d>", "<C-]>" }, cb = tree_cb("cd") },
|
||||
{ key = "<C-v>", cb = tree_cb("vsplit") },
|
||||
{ key = "<C-o>", cb = tree_cb("vsplit") },
|
||||
{ key = "<C-x>", cb = tree_cb("split") },
|
||||
{ key = "<C-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 = "<C-i>", cb = tree_cb("toggle_ignored") },
|
||||
{ key = "H", cb = tree_cb("toggle_dotfiles") },
|
||||
{ key = "R", cb = tree_cb("refresh") },
|
||||
{ key = "a", cb = tree_cb("create") },
|
||||
{ key = "d", cb = tree_cb("remove") },
|
||||
{ key = "r", 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 = "g?", cb = tree_cb("toggle_help") },
|
||||
-- Naviation h/l
|
||||
{ key = "l", action_cb = edit_or_open },
|
||||
{ key = "L", action = "vsplit_preview", action_cb = vsplit_preview },
|
||||
{ key = "h", action = "close_node" },
|
||||
{ key = "H", action = "collapse_all", action_cb = collapse_all },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
@ -0,0 +1,27 @@
|
||||
require("gitsigns").setup({
|
||||
signs = {
|
||||
add = { hl = "GitSignsAdd", text = "▌", numhl = "GitSignsAddNr" },
|
||||
change = { hl = "GitSignsChange", text = "▌", numhl = "GitSignsChangeNr" },
|
||||
delete = { hl = "GitSignsDelete", text = "―", numhl = "GitSignsDeleteNr" },
|
||||
topdelete = { hl = "GitSignsDelete", text = "‾", numhl = "GitSignsDeleteNr" },
|
||||
changedelete = { hl = "GitSignsChange", text = "~", numhl = "GitSignsChangeNr" },
|
||||
},
|
||||
numhl = false,
|
||||
keymaps = {
|
||||
-- Default keymap options
|
||||
noremap = true,
|
||||
buffer = true,
|
||||
["n ]c"] = { expr = true, "&diff ? ']c' : '<cmd>lua require\"gitsigns\".next_hunk()<CR>'" },
|
||||
["n [c"] = { expr = true, "&diff ? '[c' : '<cmd>lua require\"gitsigns\".prev_hunk()<CR>'" },
|
||||
["n <leader>hs"] = '<cmd>lua require"gitsigns".stage_hunk()<CR>',
|
||||
["n <leader>hu"] = '<cmd>lua require"gitsigns".undo_stage_hunk()<CR>',
|
||||
["n <leader>hr"] = '<cmd>lua require"gitsigns".reset_hunk()<CR>',
|
||||
["n <leader>hp"] = '<cmd>lua require"gitsigns".preview_hunk()<CR>',
|
||||
["n <leader>hb"] = '<cmd>lua require"gitsigns".blame_line()<CR>',
|
||||
},
|
||||
watch_gitdir = {
|
||||
interval = 100,
|
||||
},
|
||||
sign_priority = 5,
|
||||
status_formatter = nil, -- Use default
|
||||
})
|
@ -0,0 +1,8 @@
|
||||
local snore = { noremap = true, silent = true }
|
||||
|
||||
vim.api.nvim_set_keymap( "v", "<F1>", ":<c-u>HSHighlight 1<CR>", snore)
|
||||
vim.api.nvim_set_keymap( "v", "<F2>", ":<c-u>HSHighlight 2<CR>", snore)
|
||||
vim.api.nvim_set_keymap( "v", "<F3>", ":<c-u>HSHighlight 3<CR>", snore)
|
||||
vim.api.nvim_set_keymap( "v", "<F4>", ":<c-u>HSHighlight 4<CR>", snore)
|
||||
vim.api.nvim_set_keymap( "v", "<F5>", ":<c-u>HSRmHighlight<CR>", snore)
|
||||
vim.api.nvim_set_keymap( "v", "<F6>", ":<c-u>HSRmHighlight rm_all<CR>", snore)
|
@ -0,0 +1,111 @@
|
||||
local colors = require("themes/onedark")
|
||||
|
||||
require("nvim-web-devicons").setup({
|
||||
override = {
|
||||
html = {
|
||||
icon = "",
|
||||
color = colors.baby_pink,
|
||||
name = "html",
|
||||
},
|
||||
css = {
|
||||
icon = "",
|
||||
color = colors.blue,
|
||||
name = "css",
|
||||
},
|
||||
js = {
|
||||
icon = "",
|
||||
color = colors.sun,
|
||||
name = "js",
|
||||
},
|
||||
ts = {
|
||||
icon = "ﯤ",
|
||||
color = colors.teal,
|
||||
name = "ts",
|
||||
},
|
||||
kt = {
|
||||
icon = "",
|
||||
color = colors.orange,
|
||||
name = "kt",
|
||||
},
|
||||
png = {
|
||||
icon = "",
|
||||
color = colors.dark_purple,
|
||||
name = "png",
|
||||
},
|
||||
jpg = {
|
||||
icon = "",
|
||||
color = colors.dark_purple,
|
||||
name = "jpg",
|
||||
},
|
||||
jpeg = {
|
||||
icon = "",
|
||||
color = "colors.dark_purple",
|
||||
name = "jpeg",
|
||||
},
|
||||
mp3 = {
|
||||
icon = "",
|
||||
color = colors.white,
|
||||
name = "mp3",
|
||||
},
|
||||
mp4 = {
|
||||
icon = "",
|
||||
color = colors.white,
|
||||
name = "mp4",
|
||||
},
|
||||
out = {
|
||||
icon = "",
|
||||
color = colors.white,
|
||||
name = "out",
|
||||
},
|
||||
Dockerfile = {
|
||||
icon = "",
|
||||
color = colors.cyan,
|
||||
name = "Dockerfile",
|
||||
},
|
||||
rb = {
|
||||
icon = "",
|
||||
color = colors.pink,
|
||||
name = "rb",
|
||||
},
|
||||
vue = {
|
||||
icon = "﵂",
|
||||
color = colors.vibrant_green,
|
||||
name = "vue",
|
||||
},
|
||||
py = {
|
||||
icon = "",
|
||||
color = colors.cyan,
|
||||
name = "py",
|
||||
},
|
||||
toml = {
|
||||
icon = "",
|
||||
color = colors.blue,
|
||||
name = "toml",
|
||||
},
|
||||
lock = {
|
||||
icon = "",
|
||||
color = colors.red,
|
||||
name = "lock",
|
||||
},
|
||||
zip = {
|
||||
icon = "",
|
||||
color = colors.sun,
|
||||
name = "zip",
|
||||
},
|
||||
xz = {
|
||||
icon = "",
|
||||
color = colors.sun,
|
||||
name = "xz",
|
||||
},
|
||||
deb = {
|
||||
icon = "",
|
||||
color = colors.cyan,
|
||||
name = "deb",
|
||||
},
|
||||
rpm = {
|
||||
icon = "",
|
||||
color = colors.orange,
|
||||
name = "rpm",
|
||||
},
|
||||
},
|
||||
})
|
@ -0,0 +1,29 @@
|
||||
require("uno.plugins")
|
||||
require("uno.config")
|
||||
require("uno.notify")
|
||||
-- require("uno.lushTheming")
|
||||
require("uno.lualine.evil")
|
||||
require("uno.lsp")
|
||||
require("uno.neoformat")
|
||||
require("uno.comment")
|
||||
require("uno.colorizer")
|
||||
require("uno.dressing")
|
||||
require("uno.fileTree")
|
||||
require("uno.telescope")
|
||||
require("uno.treesitter")
|
||||
require("uno.zenmode")
|
||||
require("uno.bufferline")
|
||||
require("uno.highlights")
|
||||
require("uno.icons")
|
||||
require("uno.gitsigns")
|
||||
require("uno.terminal")
|
||||
require("uno.diffview")
|
||||
require("uno.luasnip")
|
||||
require("uno.keybindings")
|
||||
require("uno.tree")
|
||||
|
||||
-- WHY DOESN"T THIS FUCKEN WORK
|
||||
-- require("uno.quickfix")
|
||||
|
||||
-- require("uno.statusline")
|
||||
-- require("uno.modes")
|
@ -0,0 +1,140 @@
|
||||
-- Unbind
|
||||
vim.api.nvim_set_keymap("n", "Q", "", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("v", "Q", "", { noremap = true, silent = true })
|
||||
|
||||
-- Delete without yanking
|
||||
-- vim.api.nvim_set_keymap("n", "<leader>d", '"_d', { noremap = true })
|
||||
-- vim.api.nvim_set_keymap("v", "<leader>d", '"_d', { noremap = true })
|
||||
|
||||
-- Paste on new line
|
||||
vim.api.nvim_set_keymap("n", "<leader>p", "o<ESC>p", { noremap = true })
|
||||
vim.api.nvim_set_keymap("v", "<leader>p", "o<ESC>p", { noremap = true })
|
||||
|
||||
-- write only if changed
|
||||
vim.api.nvim_set_keymap("n", "<Leader>w", ":up<CR>", { noremap = true })
|
||||
vim.api.nvim_set_keymap("v", "<Leader>w", ":up<CR>", { noremap = true })
|
||||
-- quit (or close window)
|
||||
vim.api.nvim_set_keymap("n", "<Leader>q", ":q<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("v", "<Leader>q", ":q<CR>", { noremap = true, silent = true })
|
||||
-- use ZQ for :q! (quit & discard changes)
|
||||
-- Discard all changed buffers & quit
|
||||
vim.api.nvim_set_keymap("n", "<Leader>Q", ":qall!<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("v", "<Leader>Q", ":qall!<CR>", { noremap = true, silent = true })
|
||||
-- write all and quit
|
||||
vim.api.nvim_set_keymap("n", "<Leader>W", ":wqall<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("v", "<Leader>W", ":wqall<CR>", { noremap = true, silent = true })
|
||||
|
||||
-- Buffer stuff - <C-6> is toggle current and alt(last viewed)
|
||||
vim.api.nvim_set_keymap("n", "<Leader>bn", ":bn<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<Leader>bp", ":bp<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<Leader><right>", ":bn<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<Leader><left>", ":bp<CR>", { noremap = true, silent = true })
|
||||
|
||||
-- Move windows
|
||||
-- vim.api.nvim_set_keymap("n", "<C-h>", "<C-w>h", {noremap = true, silent = true})
|
||||
-- vim.api.nvim_set_keymap("n", "<C-l>", "<C-w>l", {noremap = true, silent = true})
|
||||
-- vim.api.nvim_set_keymap("n", "<C-j>", "<C-w>j", {noremap = true, silent = true})
|
||||
-- vim.api.nvim_set_keymap("n", "<C-k>", "<C-w>k", {noremap = true, silent = true})
|
||||
|
||||
-- Navigate Insert
|
||||
-- vim.api.nvim_set_keymap('i', '<C-h>', '<C-o>h', {noremap = true, silent = true})
|
||||
-- vim.api.nvim_set_keymap('i', '<C-l>', '<C-o>l', {noremap = true, silent = true})
|
||||
-- vim.api.nvim_set_keymap('i', '<C-k>', '<C-o>k', {noremap = true, silent = true})
|
||||
-- vim.api.nvim_set_keymap('i', '<C-j>', '<C-o>j', {noremap = true, silent = true})
|
||||
|
||||
-- HTML stuf
|
||||
-- Select inside tag, delete, select all tags, paste, format, beginning of line
|
||||
vim.api.nvim_set_keymap("n", "<Leader>5", "vitdvatp:Neoformat<CR>^", { noremap = true, silent = true })
|
||||
|
||||
-- Restart LSP
|
||||
vim.api.nvim_set_keymap("n", "<Leader>R", ":LspRestart<CR>", { noremap = true, silent = true })
|
||||
|
||||
-- Select all
|
||||
vim.api.nvim_set_keymap("n", "<Leader>va", "ggVG", { noremap = true, silent = true })
|
||||
|
||||
-- Git stuff
|
||||
vim.api.nvim_set_keymap("n", "<Leader>G", ":Git<CR>", { noremap = true, silent = true })
|
||||
|
||||
-- Codelens
|
||||
vim.api.nvim_set_keymap("n", "<Leader>cl", ":lua vim.lsp.codelens.run()<CR>", { noremap = true, silent = true })
|
||||
|
||||
-- Debugging
|
||||
vim.api.nvim_set_keymap(
|
||||
"n",
|
||||
"<Leader>db",
|
||||
":lua require'dap'.toggle_breakpoint()<CR>",
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
|
||||
local bind = require("go.keybind")
|
||||
bind.nvim_load_mapping({
|
||||
-- DAP --
|
||||
["<Leader>dr"] = { f = require("go.dap").run, desc = "run" },
|
||||
["<Leader>dc"] = { f = require("dap").continue, desc = "continue" },
|
||||
["<Leader>dn"] = { f = require("dap").step_over, desc = "step_over" },
|
||||
["<Leader>ds"] = { f = require("dap").step_into, desc = "step_into" },
|
||||
["<Leader>do"] = { f = require("dap").step_out, desc = "step_out" },
|
||||
["<Leader>dS"] = { f = require("go.dap").stop, desc = "stop" },
|
||||
["<Leader>du"] = { f = require("dap").up, desc = "up" },
|
||||
["<Leader>dd"] = { f = require("dap").down, desc = "down" },
|
||||
["<Leader>dC"] = { f = require("dap").run_to_cursor, desc = "run_to_cursor" },
|
||||
["<Leader>db"] = { f = require("dap").toggle_breakpoint, desc = "toggle_breakpoint" },
|
||||
["<Leader>dP"] = { f = require("dap").pause, desc = "pause" },
|
||||
["<F9>"] = { f = require("dap").continue, desc = "continue" },
|
||||
["<F10>"] = { f = require("dap").step_over, desc = "step_over" },
|
||||
["<F11>"] = { f = require("dap").step_into, desc = "step_into" },
|
||||
["<F12>"] = { f = require("dap").step_out, desc = "step_out" },
|
||||
})
|
||||
vim.api.nvim_set_keymap("n", "<Leader>dR", ":GoDebug -R<CR>", { noremap = true, silent = true })
|
||||
|
||||
-- nnoremap <silent> <F5> <Cmd>lua require'dap'.continue()<CR>
|
||||
-- nnoremap <silent> <F10> <Cmd>lua require'dap'.step_over()<CR>
|
||||
-- nnoremap <silent> <F11> <Cmd>lua require'dap'.step_into()<CR>
|
||||
-- nnoremap <silent> <F12> <Cmd>lua require'dap'.step_out()<CR>
|
||||
-- nnoremap <silent> <Leader>b <Cmd>lua require'dap'.toggle_breakpoint()<CR>
|
||||
-- nnoremap <silent> <Leader>B <Cmd>lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>
|
||||
-- nnoremap <silent> <Leader>lp <Cmd>lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Log point message: '))<CR>
|
||||
-- nnoremap <silent> <Leader>dr <Cmd>lua require'dap'.repl.open()<CR>
|
||||
-- nnoremap <silent> <Leader>dl <Cmd>lua require'dap'.run_last()<CR>
|
||||
|
||||
-- Get highlight group
|
||||
vim.keymap.set({ "i", "n" }, "<F16>", function()
|
||||
vim.cmd([[[ echo synIDattr(synID(line("."), col("."), 1), "name") ]])
|
||||
end)
|
||||
|
||||
-- Terminal stuff
|
||||
vim.api.nvim_set_keymap("t", "<C-`>", "<C-\\><C-N>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<Leader>tv", ":vsplit<bar>term<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<Leader>ts", ":split<bar>term<CR>", { noremap = true, silent = true })
|
||||
|
||||
-- local maps = {
|
||||
-- n = {
|
||||
-- ["<F10>"] = ":10sp term://fish<CR>i",
|
||||
-- ["<F12>"] = ":make<CR>",
|
||||
-- ["<F1>"] = "<nop>",
|
||||
-- ["<F8>"] = ":NvimTreeToggle<CR>",
|
||||
-- ...
|
||||
-- },
|
||||
-- i = {
|
||||
-- ["<S-Tab>"] = {map=[[pumvisible() ? "\<C-p>" : "\<S-Tab>"]], opts={noremap=true, expr=true}},
|
||||
-- ["<Tab>"] = {map=[[pumvisible() ? "\<C-n>" : "\<Tab>"]], opts={noremap=true, expr=true}},
|
||||
-- ["<c-c>"] = "<ESC>",
|
||||
-- ...
|
||||
-- },
|
||||
-- t = {
|
||||
-- ["<Esc>"] = [[<C-\><C-n>]],
|
||||
-- },
|
||||
-- c = {
|
||||
-- ["w!!"] = {map="w !sudo sponge %", opts={}}
|
||||
-- }
|
||||
-- }
|
||||
--
|
||||
-- for mode, mappings in pairs(maps) do
|
||||
-- for keys, mapping in pairs(mappings) do
|
||||
-- if (type(mapping) == "table") then
|
||||
-- vim.api.nvim_set_keymap(mode, keys, mapping.map, mapping.opts)
|
||||
-- else
|
||||
-- vim.api.nvim_set_keymap(mode, keys, mapping, {noremap=true})
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
@ -0,0 +1,40 @@
|
||||
---- Nvim-autopairs Setup
|
||||
local npairs = require("nvim-autopairs")
|
||||
npairs.setup({
|
||||
enable_check_bracket_line = false,
|
||||
ignored_next_char = "[%w%.]", -- will ignore alphanumeric and `.` symbol
|
||||
check_ts = true,
|
||||
ts_config = {
|
||||
-- it will not add pair on that treesitter node
|
||||
lua = { "string" },
|
||||
javascript = { "template_string" },
|
||||
-- don't check treesitter on java
|
||||
java = false,
|
||||
},
|
||||
})
|
||||
|
||||
local ts_conds = require("nvim-autopairs.ts-conds")
|
||||
|
||||
-- press % => %% is only inside comment or string
|
||||
local Rule = require("nvim-autopairs.rule")
|
||||
npairs.add_rules({
|
||||
Rule("%", "%", "lua"):with_pair(ts_conds.is_ts_node({ "string", "comment" })),
|
||||
-- Rule("$", "$", "lua"):with_pair(ts_conds.is_not_ts_node({"function"})),
|
||||
-- try this but with ( instead of $, maybe the params are literal characters
|
||||
-- Rule("$", "$"):with_pair(ts_conds.is_not_ts_node({"import_statement", "import_specifier"}))
|
||||
})
|
||||
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
local cmp = require("cmp")
|
||||
-- cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({map_char = {tex = ""}}))
|
||||
|
||||
local ts_utils = require("nvim-treesitter.ts_utils")
|
||||
cmp.event:on("confirm_done", function(evt)
|
||||
if ts_utils.get_node_at_cursor() then
|
||||
local name = ts_utils.get_node_at_cursor():type()
|
||||
-- and name ~= "argument_list"
|
||||
if name ~= "named_imports" and name ~= "argument_list" then
|
||||
cmp_autopairs.on_confirm_done({ map_char = { tex = "" } })(evt)
|
||||
end
|
||||
end
|
||||
end)
|
@ -0,0 +1,175 @@
|
||||
local cmp = require("cmp")
|
||||
local lspkind = require("lspkind")
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
vim.opt.shortmess:append("c")
|
||||
|
||||
require("cmp_tabnine.config"):setup({
|
||||
max_lines = 1000,
|
||||
max_num_results = 20,
|
||||
sort = true,
|
||||
run_on_every_keystroke = true,
|
||||
snippet_placeholder = "..",
|
||||
})
|
||||
|
||||
require("cmp-npm").setup({
|
||||
ignore = {},
|
||||
only_semantic_versions = true,
|
||||
})
|
||||
|
||||
local source_mapping = {
|
||||
buffer = "[Buffer]",
|
||||
nvim_lsp = "[LSP]",
|
||||
nvim_lua = "[Lua]",
|
||||
cmp_tabnine = "[TN]",
|
||||
npm = "[NPM]",
|
||||
path = "[Path]",
|
||||
luasnip = "[Snip]",
|
||||
}
|
||||
|
||||
local has_words_before = function()
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
end
|
||||
|
||||
cmp.setup({
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noinsert",
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }),
|
||||
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }),
|
||||
["<C-space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||
["<C-y>"] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
||||
["<C-e>"] = cmp.mapping({
|
||||
i = cmp.mapping.abort(),
|
||||
c = cmp.mapping.close(),
|
||||
}),
|
||||
-- Accept currently selected item. If none selected, `select` first item.
|
||||
-- Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
-- Tab scrolling
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
-- j / k navigation
|
||||
["<C-j>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<C-k>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
},
|
||||
formatting = {
|
||||
-- Formatting is responsible for the items at the end
|
||||
format = function(entry, vim_item)
|
||||
vim_item.kind = lspkind.presets.default[vim_item.kind]
|
||||
local menu = source_mapping[entry.source.name]
|
||||
if entry.source.name == "cmp_tabnine" then
|
||||
if entry.completion_item.data ~= nil and entry.completion_item.data.detail ~= nil then
|
||||
menu = entry.completion_item.data.detail .. " " .. menu
|
||||
end
|
||||
vim_item.kind = ""
|
||||
end
|
||||
vim_item.menu = menu
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "cmp_tabnine" },
|
||||
{ name = "npm", keyword_length = 4 },
|
||||
{ name = "nvim_lsp" },
|
||||
-- {name = "vsnip"} -- For vsnip users.
|
||||
{ name = "luasnip" }, -- For luasnip users.
|
||||
-- { name = 'ultisnips' }, -- For ultisnips users.
|
||||
-- { name = 'snippy' }, -- For snippy users.
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
}),
|
||||
-- Source: https://github.com/tjdevries/config_manager/blob/8f14ab2dd6ba40645af196cc40116b55c0aca3c0/xdg_config/nvim/after/plugin/completion.lua
|
||||
-- Play with this
|
||||
sorting = {
|
||||
comparators = {
|
||||
cmp.config.compare.offset,
|
||||
cmp.config.compare.exact,
|
||||
cmp.config.compare.score,
|
||||
function(entry1, entry2)
|
||||
local _, entry1_under = entry1.completion_item.label:find("^_+")
|
||||
local _, entry2_under = entry2.completion_item.label:find("^_+")
|
||||
entry1_under = entry1_under or 0
|
||||
entry2_under = entry2_under or 0
|
||||
if entry1_under > entry2_under then
|
||||
return false
|
||||
elseif entry1_under < entry2_under then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
cmp.config.compare.kind,
|
||||
cmp.config.compare.sort_text,
|
||||
cmp.config.compare.length,
|
||||
cmp.config.compare.order,
|
||||
},
|
||||
},
|
||||
experimental = {
|
||||
native_menu = false,
|
||||
ghost_text = true,
|
||||
},
|
||||
})
|
||||
|
||||
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline("/", {
|
||||
sources = {
|
||||
{ name = "buffer" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
-- cmp.setup.cmdline(
|
||||
-- ":",
|
||||
-- {
|
||||
-- sources = cmp.config.sources(
|
||||
-- {
|
||||
-- {name = "path"}
|
||||
-- },
|
||||
-- {
|
||||
-- {name = "cmdline"}
|
||||
-- }
|
||||
-- )
|
||||
-- }
|
||||
-- )
|
@ -0,0 +1,5 @@
|
||||
require("mason-nvim-dap").setup({
|
||||
ensure_installed = { "python" },
|
||||
-- Will automatically install masons tools based on selected adapters in `dap`.
|
||||
automatic_installation = true,
|
||||
})
|
@ -0,0 +1,5 @@
|
||||
-- replace the default lsp diagnostic letters with prettier symbols
|
||||
vim.fn.sign_define("LspDiagnosticsSignError", { text = "", numhl = "LspDiagnosticsDefaultError" })
|
||||
vim.fn.sign_define("LspDiagnosticsSignWarning", { text = "", numhl = "LspDiagnosticsDefaultWarning" })
|
||||
vim.fn.sign_define("LspDiagnosticsSignInformation", { text = "", numhl = "LspDiagnosticsDefaultInformation" })
|
||||
vim.fn.sign_define("LspDiagnosticsSignHint", { text = "", numhl = "LspDiagnosticsDefaultHint" })
|
@ -0,0 +1,56 @@
|
||||
require("go").setup({
|
||||
verbose = true,
|
||||
gopls_cmd = {
|
||||
"gopls",
|
||||
"-remote=auto",
|
||||
"-listen.timeout=5m",
|
||||
-- "-logfile=" .. vim.fn.expand("~/.cache/nvim/gopls.log"),
|
||||
},
|
||||
log_path = vim.fn.expand("$HOME") .. "/.cache/nvim/gonvim.log",
|
||||
comment_placeholder = " ",
|
||||
gofmt = "gofmt", -- if set to gopls will use gopls format
|
||||
test_runner = "richgo",
|
||||
lsp_cfg = false,
|
||||
lsp_keymaps = false,
|
||||
icons = { breakpoint = "🔺", currentpos = "♥️" }, -- set to false to disable
|
||||
run_in_floaterm = true, -- set to true to run in float window.
|
||||
dap_debug = true,
|
||||
dap_debug_keymap = false,
|
||||
})
|
||||
|
||||
local gofmt = function()
|
||||
vim.notify("Running formatter")
|
||||
require("go.format").goimport(true)
|
||||
end
|
||||
|
||||
local snore = { noremap = true, silent = true }
|
||||
local _go = vim.api.nvim_create_augroup("GoSettings", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "go",
|
||||
callback = function()
|
||||
vim.bo.expandtab = false
|
||||
vim.bo.tabstop = 2
|
||||
vim.bo.shiftwidth = 2
|
||||
|
||||
vim.keymap.set("n", "<Leader>gr", ":GoRun<CR>", snore)
|
||||
vim.keymap.set("n", "<Leader>gb", ":GoBuild<CR>", snore)
|
||||
vim.keymap.set("n", "<Leader>gl", ":GoLint<CR>", snore)
|
||||
vim.keymap.set("n", "<Leader>gt", ":GoTest<CR>", snore)
|
||||
vim.keymap.set("n", "<Leader>gc", require("go.comment").gen, snore)
|
||||
vim.keymap.set("n", "<Leader>gs", ":GoFillStruct<CR>", snore)
|
||||
vim.keymap.set("n", "<Leader>gdb", ":GoDebug<CR>", snore)
|
||||
vim.keymap.set("n", "<Leader>gdt", ":GoBreakToggle<CR>", snore)
|
||||
|
||||
vim.api.nvim_create_user_command("GoFmt", gofmt, { force = true })
|
||||
vim.api.nvim_create_user_command("Gtn", "TestNearest -v -tags=integration", { force = true })
|
||||
vim.api.nvim_create_user_command("Gts", "TestSuite -v -tags=integration", { force = true })
|
||||
end,
|
||||
group = _go,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = "*.go",
|
||||
command = "GoImport",
|
||||
group = _go,
|
||||
})
|
@ -0,0 +1,9 @@
|
||||
require("uno.lsp.mason")
|
||||
require("uno.lsp.dap")
|
||||
require("uno.lsp.go")
|
||||
require("uno.lsp.servers")
|
||||
require("uno.lsp.diagnostics")
|
||||
require("uno.lsp.lspkind")
|
||||
require("uno.lsp.cmp")
|
||||
require("uno.lsp.saga")
|
||||
require("uno.lsp.autopairs")
|
@ -0,0 +1,49 @@
|
||||
require("lspkind").init({
|
||||
-- DEPRECATED (use mode instead): enables text annotations
|
||||
--
|
||||
-- default: true
|
||||
-- with_text = true,
|
||||
|
||||
-- defines how annotations are shown
|
||||
-- default: symbol
|
||||
-- options: 'text', 'text_symbol', 'symbol_text', 'symbol'
|
||||
mode = "symbol_text",
|
||||
|
||||
-- default symbol map
|
||||
-- can be either 'default' (requires nerd-fonts font) or
|
||||
-- 'codicons' for codicon preset (requires vscode-codicons font)
|
||||
--
|
||||
-- default: 'default'
|
||||
preset = "codicons",
|
||||
|
||||
-- override preset symbols
|
||||
--
|
||||
-- default: {}
|
||||
symbol_map = {
|
||||
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 = "",
|
||||
},
|
||||
})
|
@ -0,0 +1,103 @@
|
||||
require('lspconfig.ui.windows').default_options.border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }
|
||||
|
||||
require("mason").setup({
|
||||
-- Controls to which degree logs are written to the log file. It's useful to set this to vim.log.levels.DEBUG when
|
||||
-- debugging issues with package installations.
|
||||
log_level = vim.log.levels.INFO,
|
||||
|
||||
-- Limit for the maximum amount of packages to be installed at the same time. Once this limit is reached, any further
|
||||
-- packages that are requested to be installed will be put in a queue.
|
||||
max_concurrent_installers = 8,
|
||||
|
||||
ui = {
|
||||
-- Whether to automatically check for new versions when opening the :Mason window.
|
||||
check_outdated_packages_on_open = true,
|
||||
|
||||
-- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.
|
||||
border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" },
|
||||
|
||||
-- icons = {
|
||||
-- -- The list icon to use for installed packages.
|
||||
-- package_installed = "◍",
|
||||
-- -- The list icon to use for packages that are installing, or queued for installation.
|
||||
-- package_pending = "◍",
|
||||
-- -- The list icon to use for packages that are not installed.
|
||||
-- package_uninstalled = "◍",
|
||||
-- },
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗",
|
||||
},
|
||||
|
||||
keymaps = {
|
||||
-- Keymap to expand a package
|
||||
toggle_package_expand = "<CR>",
|
||||
-- Keymap to install the package under the current cursor position
|
||||
install_package = "i",
|
||||
-- Keymap to reinstall/update the package under the current cursor position
|
||||
update_package = "u",
|
||||
-- Keymap to check for new version for the package under the current cursor position
|
||||
check_package_version = "c",
|
||||
-- Keymap to update all installed packages
|
||||
update_all_packages = "U",
|
||||
-- Keymap to check which installed packages are outdated
|
||||
check_outdated_packages = "C",
|
||||
-- Keymap to uninstall a package
|
||||
uninstall_package = "X",
|
||||
-- Keymap to cancel a package installation
|
||||
cancel_installation = "<C-c>",
|
||||
-- Keymap to apply language filter
|
||||
apply_language_filter = "<C-f>",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("mason-tool-installer").setup({
|
||||
|
||||
-- a list of all tools you want to ensure are installed upon
|
||||
-- start; they should be the names Mason uses for each tool
|
||||
ensure_installed = {
|
||||
-- you can pin a tool to a particular version
|
||||
|
||||
-- you can turn off/on auto_update per tool
|
||||
"bash-language-server",
|
||||
"golangci-lint",
|
||||
"lua-language-server",
|
||||
"vim-language-server",
|
||||
"stylua",
|
||||
"shellcheck",
|
||||
"editorconfig-checker",
|
||||
"gofumpt",
|
||||
"golines",
|
||||
"gomodifytags",
|
||||
"gotests",
|
||||
"impl",
|
||||
"json-to-struct",
|
||||
-- "luacheck",
|
||||
"misspell",
|
||||
"revive",
|
||||
"shellcheck",
|
||||
"shfmt",
|
||||
"staticcheck",
|
||||
"vint",
|
||||
},
|
||||
|
||||
-- if set to true this will check each tool for updates. If updates
|
||||
-- are available the tool will be updated. This setting does not
|
||||
-- affect :MasonToolsUpdate or :MasonToolsInstall.
|
||||
-- Default: false
|
||||
auto_update = true,
|
||||
|
||||
-- automatically install / update on startup. If set to false nothing
|
||||
-- will happen on startup. You can use :MasonToolsInstall or
|
||||
-- :MasonToolsUpdate to install tools and check for updates.
|
||||
-- Default: true
|
||||
run_on_start = true,
|
||||
|
||||
-- set a delay (in ms) before the installation starts. This is only
|
||||
-- effective if run_on_start is set to true.
|
||||
-- e.g.: 5000 = 5 second delay, 10000 = 10 second delay, etc...
|
||||
-- Default: 0
|
||||
start_delay = 0,
|
||||
})
|
@ -0,0 +1,69 @@
|
||||
-- LSP Saga
|
||||
require("lspsaga").init_lsp_saga({
|
||||
use_saga_diagnostic_sign = true,
|
||||
error_sign = "",
|
||||
warn_sign = "",
|
||||
hint_sign = "",
|
||||
infor_sign = "",
|
||||
diagnostic_header_icon = " ",
|
||||
code_action_icon = " ",
|
||||
code_action_prompt = {
|
||||
enable = true,
|
||||
sign = true,
|
||||
sign_priority = 20,
|
||||
virtual_text = true,
|
||||
},
|
||||
finder_definition_icon = " ",
|
||||
finder_reference_icon = " ",
|
||||
max_preview_lines = 10, -- preview lines of lsp_finder and definition preview
|
||||
finder_action_keys = {
|
||||
open = "o",
|
||||
vsplit = "s",
|
||||
split = "i",
|
||||
quit = "q",
|
||||
scroll_down = "<C-f>",
|
||||
scroll_up = "<C-b>", -- quit can be a table
|
||||
},
|
||||
code_action_keys = {
|
||||
quit = "q",
|
||||
exec = "<CR>",
|
||||
},
|
||||
rename_action_keys = {
|
||||
quit = "<C-c>",
|
||||
exec = "<CR>", -- quit can be a table
|
||||
},
|
||||
definition_preview_icon = " ",
|
||||
-- "single" "double" "round" "plus"
|
||||
border_style = "single",
|
||||
rename_prompt_prefix = "➤",
|
||||
-- if you don't use nvim-lspconfig you must pass your server name and
|
||||
-- the related filetypes into this table
|
||||
-- like server_filetype_map = {metals = {'sbt', 'scala'}}
|
||||
-- server_filetype_map = {}
|
||||
})
|
||||
|
||||
-- replace the default lsp diagnostic letters with prettier symbols
|
||||
vim.fn.sign_define("LspDiagnosticsSignError", { text = "", numhl = "LspDiagnosticsDefaultError" })
|
||||
vim.fn.sign_define("LspDiagnosticsSignWarning", { text = "", numhl = "LspDiagnosticsDefaultWarning" })
|
||||
vim.fn.sign_define("LspDiagnosticsSignInformation", { text = "", numhl = "LspDiagnosticsDefaultInformation" })
|
||||
vim.fn.sign_define("LspDiagnosticsSignHint", { text = "", numhl = "LspDiagnosticsDefaultHint" })
|
||||
|
||||
-- Set keybindings
|
||||
local snore = { noremap = true, silent = true }
|
||||
|
||||
vim.keymap.set("n", "gh", require("lspsaga.provider").lsp_finder, snore)
|
||||
vim.keymap.set("n", "<Leader>ca", require("lspsaga.codeaction").code_action, snore)
|
||||
-- old action ":<C-U>lua require('lspsaga.codeaction').range_code_action()<CR>",
|
||||
vim.keymap.set("v", "<Leader>ca", require("lspsaga.codeaction").range_code_action, snore)
|
||||
vim.keymap.set("n", "H", require("lspsaga.hover").render_hover_doc, snore)
|
||||
vim.keymap.set("n", "gs", require("lspsaga.signaturehelp").signature_help, snore)
|
||||
vim.keymap.set("n", "K", require("lspsaga.provider").preview_definition, snore)
|
||||
vim.keymap.set("n", "<Leader>cd", require("lspsaga.diagnostic").show_line_diagnostics, snore)
|
||||
vim.keymap.set("n", "<C-f>", function()
|
||||
-- Scroll up
|
||||
require("lspsaga.action").smart_scroll_with_saga(1)
|
||||
end, snore)
|
||||
vim.keymap.set("n", "<C-b>", function()
|
||||
-- Scroll down
|
||||
require("lspsaga.action").smart_scroll_with_saga(-1)
|
||||
end, snore)
|
@ -0,0 +1,420 @@
|
||||
local lsp_config = require("lspconfig")
|
||||
local cmp_lsp = require("cmp_nvim_lsp")
|
||||
local mason_lsp = require("mason-lspconfig")
|
||||
|
||||
require("null-ls").setup()
|
||||
require("mason-null-ls").setup({
|
||||
-- A list of sources to install if they're not already installed.
|
||||
-- This setting has no relation with the `automatic_installation` setting.
|
||||
ensure_installed = {
|
||||
"stylua", "jq", "goimports", "golangci_lint",
|
||||
"gitlint", "hadolint", "prettierd", "shfmt", "black",
|
||||
"yamlfmt", "codespell", "textlint", "misspell"
|
||||
},
|
||||
-- Run `require("null-ls").setup`.
|
||||
-- Will automatically install masons tools based on selected sources in `null-ls`.
|
||||
-- Can also be an exclusion list.
|
||||
-- Example: `automatic_installation = { exclude = { "rust_analyzer", "solargraph" } }`
|
||||
automatic_installation = true,
|
||||
})
|
||||
|
||||
local servers = {
|
||||
-- "ansiblels",
|
||||
"bashls",
|
||||
-- "buildifier",
|
||||
"cmake",
|
||||
"cssls",
|
||||
"denols",
|
||||
"dockerls",
|
||||
"eslint",
|
||||
"gopls",
|
||||
"golangci_lint_ls",
|
||||
"graphql",
|
||||
"grammarly",
|
||||
-- "remark_ls",
|
||||
-- "zeta_note",
|
||||
"html",
|
||||
"jsonls",
|
||||
"jdtls", -- java
|
||||
"ltex",
|
||||
"sumneko_lua",
|
||||
-- "pyright",
|
||||
"jedi_language_server",
|
||||
"sqls",
|
||||
"tsserver",
|
||||
"yamlls",
|
||||
}
|
||||
|
||||
local function common_on_attach(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
|
||||
|
||||
buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
|
||||
-- Mappings.
|
||||
local snore = { noremap = true, silent = true }
|
||||
|
||||
buf_set_keymap("n", "gD", ":lua vim.lsp.buf.declaration()<CR>", snore)
|
||||
buf_set_keymap("n", "gd", ":lua vim.lsp.buf.definition()<CR>", snore)
|
||||
-- buf_set_keymap("n", "K", ":lua vim.lsp.buf.hover()<CR>", opts)
|
||||
buf_set_keymap("n", "gi", ":lua vim.lsp.buf.implementation()<CR>", snore)
|
||||
-- buf_set_keymap("n", "<C-k>", ":lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||
buf_set_keymap("n", "<leader>wa", ":lua vim.lsp.buf.add_workspace_folder()<CR>", snore)
|
||||
buf_set_keymap("n", "<leader>wr", ":lua vim.lsp.buf.remove_workspace_folder()<CR>", snore)
|
||||
buf_set_keymap("n", "<leader>wl", ":lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>", snore)
|
||||
buf_set_keymap("n", "<leader>D", ":lua vim.lsp.buf.type_definition()<CR>", snore)
|
||||
-- buf_set_keymap("n", "<leader>rn", ":lua vim.lsp.buf.rename()<CR>", snore)
|
||||
buf_set_keymap("n", "gr", ":lua vim.lsp.buf.references()<CR>", snore)
|
||||
buf_set_keymap("n", "<leader>e", ":lua vim.diagnostic.open_float()<CR>", snore)
|
||||
buf_set_keymap("n", "[d", ":lua vim.diagnostic.goto_prev()<CR>", snore)
|
||||
buf_set_keymap("n", "]d", ":lua vim.diagnostic.goto_next()<CR>", snore)
|
||||
buf_set_keymap("n", "<leader>q", ":lua vim.diagnostic.set_loclist()<CR>", snore)
|
||||
|
||||
-- Set some keybinds conditional on server capabilities
|
||||
if client.server_capabilities.document_formatting then
|
||||
buf_set_keymap("n", "<leader>f", ":lua vim.lsp.buf.formatting()<CR>", snore)
|
||||
elseif client.server_capabilities.document_range_formatting then
|
||||
buf_set_keymap("n", "<leader>f", ":lua vim.lsp.buf.range_formatting()<CR>", snore)
|
||||
else
|
||||
buf_set_keymap("n", "<leader>f", ":Neoformat<CR>", snore)
|
||||
end
|
||||
end
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
-- A list of servers to automatically install if they're not already installed. Example: { "rust-analyzer@nightly", "sumneko_lua" }
|
||||
-- This setting has no relation with the `automatic_installation` setting.
|
||||
ensure_installed = servers,
|
||||
|
||||
-- Whether servers that are set up (via lspconfig) should be automatically installed if they're not already installed.
|
||||
-- This setting has no relation with the `ensure_installed` setting.
|
||||
-- Can either be:
|
||||
-- - false: Servers are not automatically installed.
|
||||
-- - true: All servers set up via lspconfig are automatically installed.
|
||||
-- - { exclude: string[] }: All servers set up via lspconfig, except the ones provided in the list, are automatically installed.
|
||||
-- Example: automatic_installation = { exclude = { "rust_analyzer", "solargraph" } }
|
||||
automatic_installation = true,
|
||||
})
|
||||
|
||||
local default_lsp_opts = {
|
||||
on_attach = common_on_attach,
|
||||
-- Setup cmp for all servers
|
||||
capabilities = cmp_lsp.update_capabilities(vim.lsp.protocol.make_client_capabilities()),
|
||||
-- capabilities = cmp_lsp.default_capabilities,
|
||||
}
|
||||
|
||||
-- Setup LSP Servers
|
||||
mason_lsp.setup_handlers({
|
||||
-- Default handler, for all LSP servers without explicit config
|
||||
function(server_name)
|
||||
local opts = vim.deepcopy(default_lsp_opts)
|
||||
lsp_config[server_name].setup(opts)
|
||||
end,
|
||||
|
||||
["eslint"] = function(server)
|
||||
local opts = vim.deepcopy(default_lsp_opts)
|
||||
|
||||
opts.on_attach = function(client, bufnr)
|
||||
-- neovim's LSP client does not currently support dynamic capabilities registration, so we need to set
|
||||
-- the resolved capabilities of the eslint server ourselves!
|
||||
client.server_capabilities.document_formatting = true
|
||||
common_on_attach(client, bufnr)
|
||||
end
|
||||
|
||||
opts.settings = {
|
||||
format = { enable = true }, -- this will enable formatting
|
||||
}
|
||||
|
||||
vim.bo.tabstop = 2
|
||||
vim.bo.shiftwidth = 2
|
||||
|
||||
lsp_config[server].setup(opts)
|
||||
end,
|
||||
|
||||
["sumneko_lua"] = function(server)
|
||||
local opts = vim.deepcopy(default_lsp_opts)
|
||||
|
||||
opts.settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { "vim", "use" },
|
||||
},
|
||||
workspace = {
|
||||
preloadFileSize = 1000,
|
||||
library = {
|
||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||
},
|
||||
},
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
lsp_config[server].setup(opts)
|
||||
end,
|
||||
|
||||
["denols"] = function(server)
|
||||
local opts = vim.deepcopy(default_lsp_opts)
|
||||
|
||||
opts.root_dir = lsp_config.util.root_pattern(".deno")
|
||||
|
||||
vim.bo.tabstop = 2
|
||||
vim.bo.shiftwidth = 2
|
||||
|
||||
lsp_config[server].setup(opts)
|
||||
end,
|
||||
|
||||
["tsserver"] = function(server)
|
||||
local opts = vim.deepcopy(default_lsp_opts)
|
||||
|
||||
vim.bo.tabstop = 2
|
||||
vim.bo.shiftwidth = 2
|
||||
|
||||
lsp_config[server].setup(opts)
|
||||
end,
|
||||
|
||||
["html"] = function(server)
|
||||
local opts = vim.deepcopy(default_lsp_opts)
|
||||
|
||||
opts.filetypes = { "html", "eta" }
|
||||
|
||||
lsp_config[server].setup(opts)
|
||||
end,
|
||||
|
||||
["ltex"] = function(server)
|
||||
local opts = vim.deepcopy(default_lsp_opts)
|
||||
|
||||
opts.filetypes = { "bib", "gitcommit", "org", "plaintex", "rst", "rnoweb", "tex" }
|
||||
|
||||
lsp_config[server].setup(opts)
|
||||
end,
|
||||
|
||||
["tailwindcss"] = function(server)
|
||||
local opts = vim.deepcopy(default_lsp_opts)
|
||||
|
||||
opts.filetypes = { "html", "eta", "js", "jsx", "javascript", "javascriptreact" }
|
||||
|
||||
lsp_config[server].setup(opts)
|
||||
end,
|
||||
|
||||
["golangci_lint_ls"] = function(server)
|
||||
local opts = vim.deepcopy(default_lsp_opts)
|
||||
|
||||
opts.filetypes = {"go"}
|
||||
|
||||
lsp_config[server].setup(opts)
|
||||
end,
|
||||
|
||||
["ansiblels"] = function(server)
|
||||
local opts = vim.deepcopy(default_lsp_opts)
|
||||
|
||||
opts.root_dir = lsp_config.util.root_pattern("ansible.cfg")
|
||||
|
||||
lsp_config[server].setup(opts)
|
||||
end,
|
||||
|
||||
["gopls"] = function(server)
|
||||
-- Get default config from Ray-x Go plugin
|
||||
local opts = vim.deepcopy(require("go.lsp").config())
|
||||
|
||||
local attach = opts.on_attach
|
||||
opts.on_attach = function(client, bufnr)
|
||||
common_on_attach(client, bufnr)
|
||||
attach(client, bufnr)
|
||||
end
|
||||
|
||||
opts.settings.gopls.buildFlags = { "-tags=wireinject" }
|
||||
|
||||
lsp_config[server].setup(opts)
|
||||
end,
|
||||
|
||||
["yamlls"] = function(server)
|
||||
local opts = vim.deepcopy(default_lsp_opts)
|
||||
|
||||
opts.settings = {
|
||||
yaml = {
|
||||
trace = {
|
||||
server = "verbose",
|
||||
},
|
||||
schemas = {
|
||||
["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*",
|
||||
["http://json.schemastore.org/kustomization"] = "kustomization.yaml",
|
||||
["https://json.schemastore.org/chart.json"] = "Chart.yaml",
|
||||
["https://json.schemastore.org/taskfile.json"] = "Taskfile*.yml",
|
||||
["https://raw.githubusercontent.com/GoogleContainerTools/skaffold/master/docs/content/en/schemas/v2beta26.json"] = "skaffold.yaml",
|
||||
["https://raw.githubusercontent.com/rancher/k3d/main/pkg/config/v1alpha3/schema.json"] = "k3d.yaml",
|
||||
["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.24.2/all.json"] = "/*.yaml",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
lsp_config[server].setup(opts)
|
||||
end,
|
||||
})
|
||||
|
||||
-- lspInstall + lspconfig stuff
|
||||
-- local function setup_servers()
|
||||
-- -- lspconfig variables, not used now
|
||||
-- local lspconfig = require("lspconfig")
|
||||
-- local configs = require("lspconfig.configs")
|
||||
--
|
||||
-- -- lsp installer to manager servers
|
||||
-- local lsp_installer = require("nvim-lsp-installer")
|
||||
--
|
||||
-- local servers = {
|
||||
-- -- "ansiblels",
|
||||
-- "bashls",
|
||||
-- "buildifier",
|
||||
-- "cmake",
|
||||
-- "cssls",
|
||||
-- "denols",
|
||||
-- "dockerls",
|
||||
-- "eslint",
|
||||
-- "gopls",
|
||||
-- "golangci_lint_ls",
|
||||
-- "graphql",
|
||||
-- "grammarly",
|
||||
-- -- "remark_ls",
|
||||
-- "zeta_note",
|
||||
-- "html",
|
||||
-- "jsonls",
|
||||
-- "jdtls", -- java
|
||||
-- "ltex",
|
||||
-- "sumneko_lua",
|
||||
-- -- "pyright",
|
||||
-- "jedi_language_server",
|
||||
-- "sqls",
|
||||
-- "tsserver",
|
||||
-- "yamlls",
|
||||
-- }
|
||||
--
|
||||
-- for _, name in pairs(servers) do
|
||||
-- local ok, server = lsp_installer.get_server(name)
|
||||
-- -- Check that the server is supported in nvim-lsp-installer
|
||||
-- if ok then
|
||||
-- if not server:is_installed() then
|
||||
-- print("Installing " .. name)
|
||||
-- server:install()
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- -- Register a handler that will be called for all installed servers.
|
||||
-- lsp_installer.on_server_ready(function(server)
|
||||
-- local opts = {
|
||||
-- on_attach = common_on_attach,
|
||||
-- -- Setup cmp for all servers
|
||||
-- capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()),
|
||||
-- }
|
||||
--
|
||||
-- -- (optional) Customize the options passed to the server
|
||||
-- -- if server.name == "tsserver" then
|
||||
-- -- opts.root_dir = function() ... end
|
||||
-- -- end
|
||||
--
|
||||
-- if server.name == "eslint" then
|
||||
-- opts.on_attach = function(client, bufnr)
|
||||
-- -- neovim's LSP client does not currently support dynamic capabilities registration, so we need to set
|
||||
-- -- the resolved capabilities of the eslint server ourselves!
|
||||
-- client.server_capabilities.document_formatting = true
|
||||
-- common_on_attach(client, bufnr)
|
||||
-- end
|
||||
-- opts.settings = {
|
||||
-- format = { enable = true }, -- this will enable formatting
|
||||
-- }
|
||||
-- vim.bo.tabstop = 2
|
||||
-- vim.bo.shiftwidth = 2
|
||||
-- end
|
||||
-- if server.name == "sumneko_lua" then
|
||||
-- opts.settings = {
|
||||
-- Lua = {
|
||||
-- diagnostics = {
|
||||
-- globals = { "vim", "use" },
|
||||
-- },
|
||||
-- workspace = {
|
||||
-- preloadFileSize = 1000,
|
||||
-- library = {
|
||||
-- [vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||
-- },
|
||||
-- },
|
||||
-- telemetry = {
|
||||
-- enable = false,
|
||||
-- },
|
||||
-- },
|
||||
-- }
|
||||
-- end
|
||||
-- if server.name == "denols" then
|
||||
-- opts.root_dir = lspconfig.util.root_pattern(".deno")
|
||||
-- vim.bo.tabstop = 2
|
||||
-- vim.bo.shiftwidth = 2
|
||||
-- end
|
||||
-- if server.name == "tsserver" then
|
||||
-- vim.bo.tabstop = 2
|
||||
-- vim.bo.shiftwidth = 2
|
||||
-- end
|
||||
-- if server.name == "html" then
|
||||
-- opts.filetypes = { "html", "eta" }
|
||||
-- end
|
||||
-- if server.name == "ltex" then
|
||||
-- opts.filetypes = { "bib", "gitcommit", "org", "plaintex", "rst", "rnoweb", "tex" }
|
||||
-- end
|
||||
-- if server.name == "tailwindcss" then
|
||||
-- opts.filetypes = { "html", "eta", "js", "jsx", "javascript", "javascriptreact" }
|
||||
-- end
|
||||
-- if server.name == "ansiblels" then
|
||||
-- opts.root_dir = lspconfig.util.root_pattern("ansible.cfg")
|
||||
-- end
|
||||
-- if server.name == "gopls" then
|
||||
-- local go_opts = require("go.lsp").config()
|
||||
-- local attach = go_opts.on_attach
|
||||
-- go_opts.on_attach = function(client, bufnr)
|
||||
-- common_on_attach(client, bufnr)
|
||||
-- attach(client, bufnr)
|
||||
-- end
|
||||
-- go_opts.settings.gopls.buildFlags = { "-tags=wireinject" }
|
||||
-- opts = go_opts
|
||||
-- end
|
||||
-- if server.name == "yamlls" then
|
||||
-- opts.settings = {
|
||||
-- yaml = {
|
||||
-- trace = {
|
||||
-- server = "verbose",
|
||||
-- },
|
||||
-- schemas = {
|
||||
-- ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*",
|
||||
-- ["http://json.schemastore.org/kustomization"] = "kustomization.yaml",
|
||||
-- ["https://json.schemastore.org/chart.json"] = "Chart.yaml",
|
||||
-- ["https://json.schemastore.org/taskfile.json"] = "Taskfile*.yml",
|
||||
-- ["https://raw.githubusercontent.com/GoogleContainerTools/skaffold/master/docs/content/en/schemas/v2beta26.json"] = "skaffold.yaml",
|
||||
-- ["https://raw.githubusercontent.com/rancher/k3d/main/pkg/config/v1alpha3/schema.json"] = "k3d.yaml",
|
||||
-- ["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.24.2/all.json"] = "/*.yaml",
|
||||
-- },
|
||||
-- },
|
||||
-- }
|
||||
-- end
|
||||
--
|
||||
-- -- This setup() function is exactly the same as lspconfig's setup function.
|
||||
-- -- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
-- server:setup(opts)
|
||||
-- end)
|
||||
--
|
||||
-- -- manually set up tilt server
|
||||
-- require("lspconfig").tilt_ls.setup({})
|
||||
-- end
|
||||
--
|
||||
-- setup_servers()
|
||||
|
||||
-- OUTDATED:
|
||||
-- Automatically reload after `:LspInstall <server>` so we don't have to restart neovim
|
||||
-- require "lspinstall".post_install_hook = function()
|
||||
-- setup_servers() -- reload installed servers
|
||||
-- vim.cmd("bufdo e") -- this triggers the FileType autocmd that starts the server
|
||||
-- end
|
||||
|
||||
-- LSP Signature
|
||||
-- require "lsp_signature".setup()
|
@ -0,0 +1,39 @@
|
||||
local lualine = require("lualine")
|
||||
|
||||
local colors = {
|
||||
gray = "#3C3C3C",
|
||||
lightred = "#D16969",
|
||||
blue = "#569CD6",
|
||||
pink = "#C586C0",
|
||||
black = "#262626",
|
||||
white = "#D4D4D4",
|
||||
green = "#608B4E",
|
||||
}
|
||||
|
||||
local config = {
|
||||
normal = {
|
||||
b = { fg = colors.green, bg = colors.black },
|
||||
a = { fg = colors.black, bg = colors.green, gui = "bold" },
|
||||
c = { fg = colors.white, bg = colors.black },
|
||||
},
|
||||
visual = {
|
||||
b = { fg = colors.pink, bg = colors.black },
|
||||
a = { fg = colors.black, bg = colors.pink, gui = "bold" },
|
||||
},
|
||||
inactive = {
|
||||
b = { fg = colors.black, bg = colors.blue },
|
||||
a = { fg = colors.white, bg = colors.gray, gui = "bold" },
|
||||
},
|
||||
replace = {
|
||||
b = { fg = colors.lightred, bg = colors.black },
|
||||
a = { fg = colors.black, bg = colors.lightred, gui = "bold" },
|
||||
c = { fg = colors.white, bg = colors.black },
|
||||
},
|
||||
insert = {
|
||||
b = { fg = colors.blue, bg = colors.black },
|
||||
a = { fg = colors.black, bg = colors.blue, gui = "bold" },
|
||||
c = { fg = colors.white, bg = colors.black },
|
||||
},
|
||||
}
|
||||
|
||||
lualine.setup(config)
|
@ -0,0 +1,16 @@
|
||||
local colors = {
|
||||
bg = "#202328",
|
||||
fg = "#bbc2cf",
|
||||
yellow = "#ECBE7B",
|
||||
cyan = "#008080",
|
||||
darkblue = "#081633",
|
||||
green = "#98be65",
|
||||
orange = "#FF8800",
|
||||
violet = "#a9a1e1",
|
||||
magenta = "#c678dd",
|
||||
purple = "#c678dd",
|
||||
blue = "#51afef",
|
||||
red = "#ec5f67",
|
||||
}
|
||||
|
||||
return colors
|
@ -0,0 +1,156 @@
|
||||
local conditions = require("lvim.core.lualine.conditions")
|
||||
local colors = require("lvim.core.lualine.colors")
|
||||
|
||||
local function diff_source()
|
||||
local gitsigns = vim.b.gitsigns_status_dict
|
||||
if gitsigns then
|
||||
return {
|
||||
added = gitsigns.added,
|
||||
modified = gitsigns.changed,
|
||||
removed = gitsigns.removed,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
mode = {
|
||||
function()
|
||||
return " "
|
||||
end,
|
||||
padding = { left = 0, right = 0 },
|
||||
color = {},
|
||||
cond = nil,
|
||||
},
|
||||
branch = {
|
||||
"b:gitsigns_head",
|
||||
icon = " ",
|
||||
color = { gui = "bold" },
|
||||
cond = conditions.hide_in_width,
|
||||
},
|
||||
filename = {
|
||||
"filename",
|
||||
color = {},
|
||||
cond = nil,
|
||||
},
|
||||
diff = {
|
||||
"diff",
|
||||
source = diff_source,
|
||||
symbols = { added = " ", modified = " ", removed = " " },
|
||||
diff_color = {
|
||||
added = { fg = colors.green },
|
||||
modified = { fg = colors.yellow },
|
||||
removed = { fg = colors.red },
|
||||
},
|
||||
color = {},
|
||||
cond = nil,
|
||||
},
|
||||
python_env = {
|
||||
function()
|
||||
local utils = require("lvim.core.lualine.utils")
|
||||
if vim.bo.filetype == "python" then
|
||||
local venv = os.getenv("CONDA_DEFAULT_ENV")
|
||||
if venv then
|
||||
return string.format(" (%s)", utils.env_cleanup(venv))
|
||||
end
|
||||
venv = os.getenv("VIRTUAL_ENV")
|
||||
if venv then
|
||||
return string.format(" (%s)", utils.env_cleanup(venv))
|
||||
end
|
||||
return ""
|
||||
end
|
||||
return ""
|
||||
end,
|
||||
color = { fg = colors.green },
|
||||
cond = conditions.hide_in_width,
|
||||
},
|
||||
diagnostics = {
|
||||
"diagnostics",
|
||||
sources = { "nvim_diagnostic" },
|
||||
symbols = { error = " ", warn = " ", info = " ", hint = " " },
|
||||
color = {},
|
||||
cond = conditions.hide_in_width,
|
||||
},
|
||||
treesitter = {
|
||||
function()
|
||||
local b = vim.api.nvim_get_current_buf()
|
||||
if next(vim.treesitter.highlighter.active[b]) then
|
||||
return ""
|
||||
end
|
||||
return ""
|
||||
end,
|
||||
color = { fg = colors.green },
|
||||
cond = conditions.hide_in_width,
|
||||
},
|
||||
lsp = {
|
||||
function(msg)
|
||||
msg = msg or "LS Inactive"
|
||||
local buf_clients = vim.lsp.buf_get_clients()
|
||||
if next(buf_clients) == nil then
|
||||
-- TODO: clean up this if statement
|
||||
if type(msg) == "boolean" or #msg == 0 then
|
||||
return "LS Inactive"
|
||||
end
|
||||
return msg
|
||||
end
|
||||
local buf_ft = vim.bo.filetype
|
||||
local buf_client_names = {}
|
||||
|
||||
-- add client
|
||||
for _, client in pairs(buf_clients) do
|
||||
if client.name ~= "null-ls" then
|
||||
table.insert(buf_client_names, client.name)
|
||||
end
|
||||
end
|
||||
|
||||
-- add formatter
|
||||
local formatters = require("lvim.lsp.null-ls.formatters")
|
||||
local supported_formatters = formatters.list_registered(buf_ft)
|
||||
vim.list_extend(buf_client_names, supported_formatters)
|
||||
|
||||
-- add linter
|
||||
local linters = require("lvim.lsp.null-ls.linters")
|
||||
local supported_linters = linters.list_registered(buf_ft)
|
||||
vim.list_extend(buf_client_names, supported_linters)
|
||||
|
||||
return "[" .. table.concat(buf_client_names, ", ") .. "]"
|
||||
end,
|
||||
color = { gui = "bold" },
|
||||
cond = conditions.hide_in_width,
|
||||
},
|
||||
location = { "location", cond = conditions.hide_in_width, color = {} },
|
||||
progress = { "progress", cond = conditions.hide_in_width, color = {} },
|
||||
spaces = {
|
||||
function()
|
||||
if not vim.api.nvim_buf_get_option(0, "expandtab") then
|
||||
return "Tab size: " .. vim.api.nvim_buf_get_option(0, "tabstop") .. " "
|
||||
end
|
||||
local size = vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||
if size == 0 then
|
||||
size = vim.api.nvim_buf_get_option(0, "tabstop")
|
||||
end
|
||||
return "Spaces: " .. size .. " "
|
||||
end,
|
||||
cond = conditions.hide_in_width,
|
||||
color = {},
|
||||
},
|
||||
encoding = {
|
||||
"o:encoding",
|
||||
fmt = string.upper,
|
||||
color = {},
|
||||
cond = conditions.hide_in_width,
|
||||
},
|
||||
filetype = { "filetype", cond = conditions.hide_in_width, color = {} },
|
||||
scrollbar = {
|
||||
function()
|
||||
local current_line = vim.fn.line(".")
|
||||
local total_lines = vim.fn.line("$")
|
||||
local chars = { "__", "▁▁", "▂▂", "▃▃", "▄▄", "▅▅", "▆▆", "▇▇", "██" }
|
||||
local line_ratio = current_line / total_lines
|
||||
local index = math.ceil(line_ratio * #chars)
|
||||
return chars[index]
|
||||
end,
|
||||
padding = { left = 0, right = 0 },
|
||||
color = { fg = colors.yellow, bg = colors.bg },
|
||||
cond = nil,
|
||||
},
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
local window_width_limit = 70
|
||||
|
||||
local conditions = {
|
||||
buffer_not_empty = function()
|
||||
return vim.fn.empty(vim.fn.expand("%:t")) ~= 1
|
||||
end,
|
||||
hide_in_width = function()
|
||||
return vim.fn.winwidth(0) > window_width_limit
|
||||
end,
|
||||
-- check_git_workspace = function()
|
||||
-- local filepath = vim.fn.expand "%:p:h"
|
||||
-- local gitdir = vim.fn.finddir(".git", filepath .. ";")
|
||||
-- return gitdir and #gitdir > 0 and #gitdir < #filepath
|
||||
-- end,
|
||||
}
|
||||
|
||||
return conditions
|
@ -0,0 +1,47 @@
|
||||
local M = {}
|
||||
M.config = function()
|
||||
lvim.builtin.lualine = {
|
||||
active = true,
|
||||
style = "lvim",
|
||||
options = {
|
||||
icons_enabled = nil,
|
||||
component_separators = nil,
|
||||
section_separators = nil,
|
||||
theme = nil,
|
||||
disabled_filetypes = nil,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = nil,
|
||||
lualine_b = nil,
|
||||
lualine_c = nil,
|
||||
lualine_x = nil,
|
||||
lualine_y = nil,
|
||||
lualine_z = nil,
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = nil,
|
||||
lualine_b = nil,
|
||||
lualine_c = nil,
|
||||
lualine_x = nil,
|
||||
lualine_y = nil,
|
||||
lualine_z = nil,
|
||||
},
|
||||
tabline = nil,
|
||||
extensions = nil,
|
||||
on_config_done = nil,
|
||||
}
|
||||
end
|
||||
|
||||
M.setup = function()
|
||||
require("lvim.core.lualine.styles").update()
|
||||
require("lvim.core.lualine.utils").validate_theme()
|
||||
|
||||
local lualine = require("lualine")
|
||||
lualine.setup(lvim.builtin.lualine)
|
||||
|
||||
if lvim.builtin.lualine.on_config_done then
|
||||
lvim.builtin.lualine.on_config_done(lualine)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,137 @@
|
||||
local M = {}
|
||||
local components = require("lvim.core.lualine.components")
|
||||
|
||||
local styles = {
|
||||
lvim = nil,
|
||||
default = nil,
|
||||
none = nil,
|
||||
}
|
||||
|
||||
styles.none = {
|
||||
style = "none",
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {},
|
||||
}
|
||||
|
||||
styles.default = {
|
||||
style = "default",
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch" },
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "encoding", "fileformat", "filetype" },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {},
|
||||
}
|
||||
|
||||
styles.lvim = {
|
||||
style = "lvim",
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = { "dashboard", "NvimTree", "Outline" },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {
|
||||
components.mode,
|
||||
},
|
||||
lualine_b = {
|
||||
components.branch,
|
||||
components.filename,
|
||||
},
|
||||
lualine_c = {
|
||||
components.diff,
|
||||
components.python_env,
|
||||
},
|
||||
lualine_x = {
|
||||
components.diagnostics,
|
||||
components.treesitter,
|
||||
components.lsp,
|
||||
components.filetype,
|
||||
},
|
||||
lualine_y = {},
|
||||
lualine_z = {
|
||||
components.scrollbar,
|
||||
},
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {
|
||||
"filename",
|
||||
},
|
||||
lualine_b = {},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = { "nvim-tree" },
|
||||
}
|
||||
|
||||
function M.get_style(style)
|
||||
local style_keys = vim.tbl_keys(styles)
|
||||
if not vim.tbl_contains(style_keys, style) then
|
||||
local Log = require("lvim.core.log")
|
||||
Log:error(
|
||||
"Invalid lualine style",
|
||||
string.format('"%s"', style),
|
||||
"options are: ",
|
||||
string.format('"%s"', table.concat(style_keys, '", "'))
|
||||
)
|
||||
Log:debug('"lvim" style is applied.')
|
||||
style = "lvim"
|
||||
end
|
||||
|
||||
return vim.deepcopy(styles[style])
|
||||
end
|
||||
|
||||
function M.update()
|
||||
local style = M.get_style(lvim.builtin.lualine.style)
|
||||
if lvim.builtin.lualine.options.theme == nil then
|
||||
lvim.builtin.lualine.options.theme = lvim.colorscheme
|
||||
end
|
||||
|
||||
lvim.builtin.lualine = vim.tbl_deep_extend("keep", lvim.builtin.lualine, style)
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,27 @@
|
||||
local M = {}
|
||||
|
||||
function M.validate_theme()
|
||||
local theme = lvim.builtin.lualine.options.theme
|
||||
if type(theme) == "table" then
|
||||
return
|
||||
end
|
||||
|
||||
local lualine_loader = require("lualine.utils.loader")
|
||||
local ok = pcall(lualine_loader.load_theme, theme)
|
||||
if not ok then
|
||||
lvim.builtin.lualine.options.theme = "auto"
|
||||
end
|
||||
end
|
||||
|
||||
function M.env_cleanup(venv)
|
||||
if string.find(venv, "/") then
|
||||
local final_venv = venv
|
||||
for w in venv:gmatch("([^/]+)") do
|
||||
final_venv = w
|
||||
end
|
||||
venv = final_venv
|
||||
end
|
||||
return venv
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,54 @@
|
||||
local ls = require("luasnip")
|
||||
local types = require("luasnip.util.types")
|
||||
|
||||
ls.config.set_config({
|
||||
-- This tells LuaSnip to remember to keep around the last snippet.
|
||||
-- You can jump back into it even if you move outside of the selection
|
||||
history = true,
|
||||
-- This one is cool cause if you have dynamic snippets, it updates as you type!
|
||||
updateevents = "TextChanged,TextChangedI",
|
||||
-- Autosnippets:
|
||||
enable_autosnippets = true,
|
||||
-- Crazy highlights!!
|
||||
-- #vid3
|
||||
-- ext_opts = nil,
|
||||
ext_opts = {
|
||||
[types.choiceNode] = {
|
||||
active = {
|
||||
virt_text = { { "<-", "Error" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("luasnip.loaders.from_vscode").load()
|
||||
|
||||
ls.filetype_extend("javascript", { "javascriptreact", "html" })
|
||||
ls.filetype_extend("javascriptreact", { "html", "javascript" })
|
||||
|
||||
-- <c-k> is my expansion key
|
||||
-- this will expand the current item or jump to the next item within the snippet.
|
||||
vim.keymap.set({ "i", "s" }, "<c-k>", function()
|
||||
if ls.expand_or_jumpable() then
|
||||
ls.expand_or_jump()
|
||||
end
|
||||
end, { silent = true })
|
||||
|
||||
-- <c-j> is my jump backwards key.
|
||||
-- this always moves to the previous item within the snippet
|
||||
vim.keymap.set({ "i", "s" }, "<c-j>", function()
|
||||
if ls.jumpable(-1) then
|
||||
ls.jump(-1)
|
||||
end
|
||||
end, { silent = true })
|
||||
|
||||
-- <c-l> is selecting within a list of options.
|
||||
-- This is useful for choice nodes (introduced in the forthcoming episode 2)
|
||||
vim.keymap.set("i", "<c-l>", function()
|
||||
if ls.choice_active() then
|
||||
ls.change_choice(1)
|
||||
end
|
||||
end)
|
||||
|
||||
-- shorcut to source my luasnips file again, which will reload my snippets
|
||||
vim.keymap.set("n", "<leader><leader>s", "<cmd>source ~/.config/nvim/lua/uno/luasnip.lua<CR>")
|
@ -0,0 +1,20 @@
|
||||
local lush = require("lush")
|
||||
|
||||
-- Get Highlight Undeer Cursor:
|
||||
-- execute 'hi' synIDattr(synID(line("."), col("."), 1), "name")
|
||||
|
||||
lush(require("themes.pywal"))
|
||||
vim.cmd("colorscheme pywal")
|
||||
|
||||
-- Watch pywal cache file for color changes
|
||||
local fwatch = require("fwatch")
|
||||
fwatch.watch(vim.fn.expand("$HOME") .. "/.cache/wal/colors", {
|
||||
on_event = function()
|
||||
-- Reapply colorscheme 200ms after file changed
|
||||
vim.defer_fn(function()
|
||||
package.loaded["themes.pywal"] = nil
|
||||
require("lush")(require("themes.pywal"))
|
||||
-- vim.cmd("colorscheme pywal")
|
||||
end, 100)
|
||||
end,
|
||||
})
|
@ -0,0 +1,21 @@
|
||||
vim.opt.cursorline = true
|
||||
require("modes").setup({
|
||||
-- colors = {
|
||||
-- copy = "#f5c359",
|
||||
-- delete = "#c75c6a",
|
||||
-- insert = "#78ccc5",
|
||||
-- visual = "#9745be"
|
||||
-- },
|
||||
-- Cursorline highlight opacity
|
||||
line_opacity = 0.1,
|
||||
-- Highlight cursor
|
||||
set_cursor = true,
|
||||
-- Highlight in active window only
|
||||
focus_only = true,
|
||||
})
|
||||
|
||||
-- Exposed highlight groups, useful for themes
|
||||
-- vim.cmd("hi ModesCopy guibg=#f5c359-- ")
|
||||
-- vim.cmd("hi ModesDelete guibg=#c75c6a")
|
||||
-- vim.cmd("hi ModesInsert guibg=#78ccc5")
|
||||
-- vim.cmd("hi ModesVisual guibg=#9745be")
|
@ -0,0 +1,26 @@
|
||||
local myFuncs = {}
|
||||
|
||||
-- https://github.com/akinsho/bufferline.nvim/issues/140
|
||||
function myFuncs.closeBuffer()
|
||||
local treeView = require("nvim-tree.view")
|
||||
local bufferline = require("bufferline")
|
||||
|
||||
-- check if NvimTree window was open
|
||||
local explorerWindow = treeView.get_winnr()
|
||||
local wasExplorerOpen = vim.api.nvim_win_is_valid(explorerWindow)
|
||||
|
||||
local bufferToDelete = vim.api.nvim_get_current_buf()
|
||||
|
||||
-- TODO: handle modified buffers
|
||||
-- local isModified = vim.api.nvim_eval('getbufvar(' .. bufferToDelete .. ', "&mod")')
|
||||
|
||||
if wasExplorerOpen then
|
||||
-- switch to previous buffer (tracked by bufferline)
|
||||
bufferline.cycle(-1)
|
||||
end
|
||||
|
||||
-- delete initially open buffer
|
||||
vim.cmd("bdelete! " .. bufferToDelete)
|
||||
end
|
||||
|
||||
return myFuncs
|
@ -0,0 +1,50 @@
|
||||
-- Load tilt file
|
||||
local tg = vim.api.nvim_create_augroup("Tiltfile", { clear = true })
|
||||
vim.api.nvim_create_autocmd("BufRead", {
|
||||
pattern = { "Tiltfile" },
|
||||
callback = function()
|
||||
vim.bo.filetype = "tiltfile"
|
||||
vim.bo.syntax = "python"
|
||||
-- vim.cmd([[vim.bo.syntax = "python"]])
|
||||
end,
|
||||
group = tg,
|
||||
})
|
||||
|
||||
vim.g.neoformat_enabled_json = { "prettier" }
|
||||
vim.g.neoformat_enabled_lua = { "stylua" }
|
||||
vim.g.neoformat_enabled_sql = { "pg_format" }
|
||||
vim.g.neoformat_enabled_json = { "prettier" }
|
||||
vim.g.neoformat_enabled_python= { "black" }
|
||||
|
||||
local fg = vim.api.nvim_create_augroup("Neoformat", { clear = true })
|
||||
-- General formater
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = { ".sql", ".lua", "*.json", "*.css", "Tiltfile", "*.js", "*.jsx", "*.proto", "*.py", "*.html" },
|
||||
command = "Neoformat",
|
||||
group = fg,
|
||||
})
|
||||
|
||||
-- SQL tabs
|
||||
local sg = vim.api.nvim_create_augroup("Sql", { clear = true })
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "sql" },
|
||||
callback = function()
|
||||
vim.bo.tabstop = 8
|
||||
vim.bo.softtabstop = 0
|
||||
vim.bo.shiftwidth = 4
|
||||
vim.bo.smartindent = true
|
||||
vim.bo.expandtab = true
|
||||
end,
|
||||
group = sg,
|
||||
})
|
||||
|
||||
-- vim.api.nvim_exec([[ autocmd BufRead *.sql set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab ]], false)
|
||||
|
||||
vim.api.nvim_exec(
|
||||
[[
|
||||
aug i3config_ft_detection
|
||||
au!
|
||||
au BufNewFile,BufRead ~/.config/i3/config set filetype=i3config
|
||||
aug end ]],
|
||||
false
|
||||
)
|
@ -0,0 +1,75 @@
|
||||
require("notify").setup({
|
||||
-- Animation style (see below for details)
|
||||
stages = "fade_in_slide_out",
|
||||
-- Function called when a new window is opened, use for changing win settings/config
|
||||
on_open = nil,
|
||||
-- Function called when a window is closed
|
||||
on_close = nil,
|
||||
-- Render function for notifications. See notify-render()
|
||||
render = "default",
|
||||
-- Default timeout for notifications
|
||||
timeout = 5000,
|
||||
-- Max number of columns for messages
|
||||
max_width = nil,
|
||||
-- Max number of lines for a message
|
||||
max_height = nil,
|
||||
-- For stages that change opacity this is treated as the highlight behind the window
|
||||
-- Set this to either a highlight group, an RGB hex value e.g. "#000000" or a function returning an RGB code for dynamic values
|
||||
background_colour = "#121212",
|
||||
-- Minimum width for notification windows
|
||||
minimum_width = 50,
|
||||
-- Icons for the different levels
|
||||
icons = {
|
||||
ERROR = "",
|
||||
WARN = "",
|
||||
INFO = "",
|
||||
DEBUG = "",
|
||||
TRACE = "✎",
|
||||
},
|
||||
})
|
||||
|
||||
local function starts_with(str, start)
|
||||
return str:sub(1, #start) == start
|
||||
end
|
||||
|
||||
vim.notify = function(msg, level, opts)
|
||||
if opts == nil then
|
||||
opts = {}
|
||||
end
|
||||
|
||||
-- Don't overwrite title
|
||||
if opts["title"] == nil then
|
||||
-- Get caller info
|
||||
d = debug.getinfo(2)
|
||||
opts["title"] = "(Source) " .. d.source
|
||||
|
||||
-- Extract path
|
||||
possible_matches = {
|
||||
{
|
||||
path = "@" .. vim.fn.expand("$HOME") .. "/.local/share/nvim/site/pack/packer/start/",
|
||||
prefix = "(Plugin) ",
|
||||
},
|
||||
{
|
||||
path = "@" .. vim.fn.expand("$HOME") .. "/.local/share/nvim/site/pack/packer/opt/",
|
||||
prefix = "(Plugin) ",
|
||||
},
|
||||
{
|
||||
path = "@" .. vim.fn.expand("$HOME") .. "/.config/nvim/lua/uno/",
|
||||
prefix = "(Config) ",
|
||||
},
|
||||
{
|
||||
path = "@" .. "/usr/share/nvim/runtime/lua/",
|
||||
prefix = "(Nvim) ",
|
||||
},
|
||||
}
|
||||
|
||||
-- Set title
|
||||
for _, m in pairs(possible_matches) do
|
||||
if starts_with(d.source, m.path) then
|
||||
opts["title"] = m.prefix .. d.source:sub(#m.path + 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
require("notify")(msg, level, opts)
|
||||
end
|
@ -0,0 +1,186 @@
|
||||
local execute = vim.api.nvim_command
|
||||
local fn = vim.fn
|
||||
|
||||
-- local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
||||
|
||||
-- if fn.empty(fn.glob(install_path)) > 0 then
|
||||
-- fn.system({ "git", "clone", "https://github.com/wbthomason/packer.nvim", install_path })
|
||||
execute("packadd packer.nvim")
|
||||
-- end
|
||||
|
||||
return require("packer").startup(function()
|
||||
-- Packer can manage itself
|
||||
use("wbthomason/packer.nvim")
|
||||
|
||||
-- Faster startup
|
||||
use({
|
||||
"lewis6991/impatient.nvim",
|
||||
config = require("impatient").setup,
|
||||
})
|
||||
use("nathom/filetype.nvim")
|
||||
|
||||
-- Telescope
|
||||
use("folke/trouble.nvim")
|
||||
use("nvim-lua/popup.nvim")
|
||||
use({ "nvim-telescope/telescope-fzf-native.nvim", run = "make" })
|
||||
use({
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
"danielpieper/telescope-tmuxinator.nvim",
|
||||
"nvim-telescope/telescope-ui-select.nvim",
|
||||
"nvim-telescope/telescope-media-files.nvim",
|
||||
"nvim-telescope/telescope-project.nvim",
|
||||
"nvim-telescope/telescope-dap.nvim",
|
||||
"nvim-telescope/telescope-fzy-native.nvim",
|
||||
"nvim-telescope/telescope-symbols.nvim",
|
||||
"cljoly/telescope-repo.nvim",
|
||||
})
|
||||
|
||||
-- Theming
|
||||
use("dylanaraps/wal.vim")
|
||||
use("deviantfero/wpgtk.vim")
|
||||
use("ryanoasis/vim-devicons")
|
||||
use("rktjmp/lush.nvim")
|
||||
use("akinsho/nvim-bufferline.lua")
|
||||
use("norcalli/nvim-colorizer.lua")
|
||||
use("kyazdani42/nvim-web-devicons")
|
||||
|
||||
use({
|
||||
"anuvyklack/windows.nvim",
|
||||
requires = {
|
||||
"anuvyklack/middleclass",
|
||||
-- "anuvyklack/animation.nvim",
|
||||
},
|
||||
config = function()
|
||||
-- vim.o.winwidth = 10
|
||||
-- vim.o.winminwidth = 10
|
||||
-- vim.o.equalalways = false
|
||||
require("windows").setup()
|
||||
end,
|
||||
})
|
||||
|
||||
-- Status line
|
||||
-- use {"joshuaMarple/galaxyline.nvim"}
|
||||
use({ "nvim-lualine/lualine.nvim" })
|
||||
|
||||
-- Software Devlopment
|
||||
use("ekalinin/Dockerfile.vim")
|
||||
use("windwp/nvim-autopairs")
|
||||
use({
|
||||
"windwp/nvim-ts-autotag",
|
||||
config = function()
|
||||
require("nvim-ts-autotag").setup({ enable = true })
|
||||
end,
|
||||
})
|
||||
-- use("alvan/vim-closetag")
|
||||
use("ray-x/lsp_signature.nvim")
|
||||
|
||||
-- Nvim Treesitter
|
||||
use({
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = ":TSUpdate",
|
||||
requires = {
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
"nvim-treesitter/playground",
|
||||
},
|
||||
})
|
||||
|
||||
use({"nvim-treesitter/nvim-treesitter-refactor"})
|
||||
|
||||
|
||||
-- Golang
|
||||
use({
|
||||
"ray-x/go.nvim",
|
||||
requires = {
|
||||
"mfussenegger/nvim-dap", -- Debug Adapter Protocol
|
||||
"rcarriga/nvim-dap-ui",
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
"ray-x/guihua.lua",
|
||||
},
|
||||
})
|
||||
|
||||
-- Nvim LSP
|
||||
use({
|
||||
"neovim/nvim-lspconfig",
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"jayp0521/mason-nvim-dap.nvim",
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
"jayp0521/mason-null-ls.nvim",
|
||||
after = "go.nvim",
|
||||
})
|
||||
use("onsails/lspkind-nvim")
|
||||
use("tami5/lspsaga.nvim")
|
||||
|
||||
-- LSP Completion
|
||||
use("hrsh7th/cmp-nvim-lsp")
|
||||
use("hrsh7th/cmp-buffer")
|
||||
use("hrsh7th/cmp-path")
|
||||
use("hrsh7th/cmp-cmdline")
|
||||
use("hrsh7th/nvim-cmp")
|
||||
use({ "tzachar/cmp-tabnine", run = "./install.sh", requires = "hrsh7th/nvim-cmp" })
|
||||
use({
|
||||
"David-Kunz/cmp-npm",
|
||||
-- after = "cmp-tabnine",
|
||||
})
|
||||
use({ "saadparwaiz1/cmp_luasnip" }) -- , after = "cmp-npm"
|
||||
use({ "L3MON4D3/LuaSnip", requires = { "rafamadriz/friendly-snippets" } }) -- , after = "cmp_luasnip"
|
||||
|
||||
-- Lsp Addons
|
||||
use({ "stevearc/dressing.nvim", requires = "MunifTanjim/nui.nvim" })
|
||||
use({ "folke/lsp-trouble.nvim" })
|
||||
use({ "jose-elias-alvarez/nvim-lsp-ts-utils", after = { "nvim-treesitter" } })
|
||||
|
||||
-- Misc
|
||||
use("kyazdani42/nvim-tree.lua")
|
||||
use("Pocco81/TrueZen.nvim")
|
||||
use("rktjmp/fwatch.nvim") -- file watcher for themes
|
||||
use("sbdchd/neoformat") -- file formatting
|
||||
use("akinsho/nvim-toggleterm.lua")
|
||||
use({ "AndrewRadev/splitjoin.vim" }) -- to expand / contract multiline
|
||||
use({ "numToStr/Comment.nvim" }) -- Comment stuff
|
||||
use({ "JoosepAlviste/nvim-ts-context-commentstring" }) -- , after = "nvim-treesitter"
|
||||
use({ "tpope/vim-repeat" })
|
||||
use({ "tpope/vim-speeddating" })
|
||||
use({ "tpope/vim-surround" })
|
||||
use({ "folke/todo-comments.nvim", config = "require('todo-comments')" })
|
||||
use({ "antoinemadec/FixCursorHold.nvim" }) -- Needed while issue https://github.com/neovim/neovim/issues/12587 is still open
|
||||
use({ "rcarriga/nvim-notify" })
|
||||
use({
|
||||
"vuki656/package-info.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
config = "require('package-info').setup()",
|
||||
})
|
||||
use({
|
||||
"iamcco/markdown-preview.nvim",
|
||||
run = "cd app && npm install",
|
||||
setup = function()
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
end,
|
||||
ft = { "markdown" },
|
||||
})
|
||||
use({ "mattn/emmet-vim" })
|
||||
use({ "potatoesmaster/i3-vim-syntax" })
|
||||
-- use {"airblade/vim-rooter"}
|
||||
use({ "mvllow/modes.nvim" }) -- Highlights current line based on mode
|
||||
use({ "zegervdv/nrpattern.nvim", config = "require('nrpattern').setup()" })
|
||||
use({ "kevinhwang91/nvim-bqf", ft = "qf" }) -- Nicer quickfix list
|
||||
use("Pocco81/HighStr.nvim") -- Highlight lines
|
||||
|
||||
-- Git stuff
|
||||
use("ThePrimeagen/git-worktree.nvim") -- look into how this works
|
||||
use("tpope/vim-fugitive") -- what is this again?
|
||||
use({ "sindrets/diffview.nvim", "nvim-lua/plenary.nvim" })
|
||||
|
||||
use("ThePrimeagen/harpoon") -- what is this again?
|
||||
use("famiu/nvim-reload")
|
||||
-- use("dlee/nvim-reload")
|
||||
|
||||
use({ "lewis6991/gitsigns.nvim" })
|
||||
|
||||
use { "ellisonleao/gruvbox.nvim" }
|
||||
|
||||
-- use 'dstein64/vim-startuptime'
|
||||
end)
|
@ -0,0 +1,56 @@
|
||||
local fn = vim.fn
|
||||
|
||||
function _G.qftf(info)
|
||||
local items
|
||||
local ret = {}
|
||||
if info.quickfix == 1 then
|
||||
items = fn.getqflist({ id = info.id, items = 0 }).items
|
||||
else
|
||||
items = fn.getloclist(info.winid, { id = info.id, items = 0 }).items
|
||||
end
|
||||
local limit = 31
|
||||
local fnameFmt1, fnameFmt2 = "%-" .. limit .. "s", "…%." .. (limit - 1) .. "s"
|
||||
local validFmt = "%s │%5d:%-3d│%s %s"
|
||||
for i = info.start_idx, info.end_idx do
|
||||
local e = items[i]
|
||||
local fname = ""
|
||||
local str
|
||||
if e.valid == 1 then
|
||||
if e.bufnr > 0 then
|
||||
fname = fn.bufname(e.bufnr)
|
||||
if fname == "" then
|
||||
fname = "[No Name]"
|
||||
else
|
||||
fname = fname:gsub("^" .. vim.env.HOME, "~")
|
||||
end
|
||||
-- char in fname may occur more than 1 width, ignore this issue in order to keep performance
|
||||
if #fname <= limit then
|
||||
fname = fnameFmt1:format(fname)
|
||||
else
|
||||
fname = fnameFmt2:format(fname:sub(1 - limit))
|
||||
end
|
||||
end
|
||||
local lnum = e.lnum > 99999 and -1 or e.lnum
|
||||
local col = e.col > 999 and -1 or e.col
|
||||
local qtype = e.type == "" and "" or " " .. e.type:sub(1, 1):upper()
|
||||
str = validFmt:format(fname, lnum, col, qtype, e.text)
|
||||
else
|
||||
str = e.text
|
||||
end
|
||||
table.insert(ret, str)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
vim.o.qftf = "{info -> v:lua._G.qftf(info)}"
|
||||
|
||||
-- Adapt fzf's delimiter in nvim-bqf
|
||||
require("bqf").setup({
|
||||
auto_enable = true,
|
||||
auto_resize_height = true,
|
||||
filter = {
|
||||
fzf = {
|
||||
extra_opts = { "--bind", "ctrl-o:toggle-all", "--delimiter", "│" },
|
||||
},
|
||||
},
|
||||
})
|
@ -0,0 +1,61 @@
|
||||
local Path = require("plenary.path")
|
||||
local action_set = require("telescope.actions.set")
|
||||
local action_state = require("telescope.actions.state")
|
||||
local actions = require("telescope.actions")
|
||||
local conf = require("telescope.config").values
|
||||
local finders = require("telescope.finders")
|
||||
local make_entry = require("telescope.make_entry")
|
||||
local os_sep = Path.path.sep
|
||||
local pickers = require("telescope.pickers")
|
||||
local scan = require("plenary.scandir")
|
||||
|
||||
local my_pickers = {}
|
||||
|
||||
-- Picker to select folder to livegrep in.
|
||||
my_pickers.live_grep_in_folder = function(opts)
|
||||
-- Default options
|
||||
opts = opts or {
|
||||
hidden = true,
|
||||
}
|
||||
|
||||
local data = {}
|
||||
scan.scan_dir(vim.loop.cwd(), {
|
||||
hidden = opts.hidden,
|
||||
only_dirs = true,
|
||||
respect_gitignore = opts.respect_gitignore,
|
||||
on_insert = function(entry)
|
||||
table.insert(data, entry .. os_sep)
|
||||
end,
|
||||
})
|
||||
table.insert(data, 1, "." .. os_sep)
|
||||
|
||||
pickers
|
||||
.new(opts, {
|
||||
prompt_title = "Folders for Live Grep",
|
||||
finder = finders.new_table({ results = data, entry_maker = make_entry.gen_from_file(opts) }),
|
||||
previewer = conf.file_previewer(opts),
|
||||
sorter = conf.file_sorter(opts),
|
||||
attach_mappings = function(prompt_bufnr)
|
||||
action_set.select:replace(function()
|
||||
local current_picker = action_state.get_current_picker(prompt_bufnr)
|
||||
local dirs = {}
|
||||
local selections = current_picker:get_multi_selection()
|
||||
if vim.tbl_isempty(selections) then
|
||||
table.insert(dirs, action_state.get_selected_entry().value)
|
||||
else
|
||||
for _, selection in ipairs(selections) do
|
||||
table.insert(dirs, selection.value)
|
||||
end
|
||||
end
|
||||
actions._close(prompt_bufnr, current_picker.initial_mode == "insert")
|
||||
|
||||
-- Send results to live_grep
|
||||
require("telescope.builtin").live_grep({ search_dirs = dirs })
|
||||
end)
|
||||
return true
|
||||
end,
|
||||
})
|
||||
:find()
|
||||
end
|
||||
|
||||
return my_pickers
|
@ -0,0 +1,151 @@
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
local my_pickers = require("uno.telescope-pickers")
|
||||
|
||||
require("trouble").setup()
|
||||
local trouble = require("trouble.providers.telescope")
|
||||
|
||||
local M = {}
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
-- find_command = {'rg', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case', '--max-depth 5'},
|
||||
prompt_prefix = " ",
|
||||
-- prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
entry_prefix = " ",
|
||||
initial_mode = "insert",
|
||||
-- initial_mode = "insert",
|
||||
selection_strategy = "reset",
|
||||
sorting_strategy = "descending",
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = {
|
||||
prompt_position = "bottom",
|
||||
-- preview_cutoff = 120,
|
||||
horizontal = { width = 0.8, mirror = false },
|
||||
vertical = { mirror = false },
|
||||
},
|
||||
-- file_sorter = require("telescope.sorters").get_fzy_sorter,
|
||||
file_ignore_patterns = {
|
||||
"node_modules/",
|
||||
"vendor/",
|
||||
".git/",
|
||||
},
|
||||
-- generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter,
|
||||
path_display = {
|
||||
shorten = {
|
||||
len = 3,
|
||||
exclude = {1, -1}
|
||||
}
|
||||
},
|
||||
winblend = 0,
|
||||
border = {},
|
||||
borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" },
|
||||
color_devicons = true,
|
||||
-- use_less = true,
|
||||
set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil,
|
||||
file_previewer = require("telescope.previewers").vim_buffer_cat.new,
|
||||
grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new,
|
||||
qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new,
|
||||
-- Developer configurations: Not meant for general override
|
||||
-- buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker,
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-c>"] = actions.close,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<c-t>"] = trouble.open_with_trouble,
|
||||
["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
|
||||
-- To disable a keymap, put [map] = false
|
||||
-- So, to not map "<C-n>", just put
|
||||
-- ["<c-x>"] = false,
|
||||
-- ["<esc>"] = actions.close,
|
||||
|
||||
-- Otherwise, just set the mapping to the function that you want it to be.
|
||||
-- ["<C-i>"] = actions.select_horizontal,
|
||||
|
||||
-- Add up multiple actions
|
||||
["<CR>"] = actions.select_default + actions.center,
|
||||
|
||||
-- You can perform as many actions in a row as you like
|
||||
-- ["<CR>"] = actions.select_default + actions.center + my_cool_custom_action,
|
||||
},
|
||||
n = {
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<c-t>"] = trouble.open_with_trouble,
|
||||
["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
|
||||
-- ["<C-i>"] = my_cool_custom_action,
|
||||
},
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
-- fzf = {
|
||||
-- fuzzy = true, -- false will only do exact matching
|
||||
-- override_generic_sorter = true, -- override the generic sorter
|
||||
-- override_file_sorter = true, -- override the file sorter
|
||||
-- case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||
-- },
|
||||
media_files = {
|
||||
-- filetypes whitelist
|
||||
-- defaults to {"png", "jpg", "mp4", "webm", "pdf"}
|
||||
filetypes = { "png", "webp", "jpg", "jpeg", "pdf", "webm", "mp4", "mp3", "mkv" },
|
||||
},
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown({}),
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
grep_in_folder = my_pickers.live_grep_in_folder,
|
||||
find_files = {
|
||||
find_command = {
|
||||
"fd",
|
||||
"--max-depth",
|
||||
"8",
|
||||
"--hidden",
|
||||
"--follow",
|
||||
"--type",
|
||||
"f",
|
||||
"--strip-cwd-prefix",
|
||||
"--follow",
|
||||
"--no-ignore-vcs",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("telescope").load_extension("fzy_native")
|
||||
-- require("telescope").load_extension("fzf")
|
||||
-- require("telescope").load_extension("project")
|
||||
-- require("telescope").load_extension("projects") -- ahmedkhalf/project.nvim
|
||||
require("telescope").load_extension("media_files")
|
||||
require("telescope").load_extension("ui-select")
|
||||
require("telescope").load_extension("tmuxinator")
|
||||
require("telescope").load_extension("notify")
|
||||
require("telescope").load_extension("file_browser")
|
||||
require("telescope").load_extension("dap")
|
||||
require("telescope").load_extension("repo")
|
||||
|
||||
-- Native
|
||||
vim.keymap.set("n", "<leader>ff", ":Telescope find_files<CR>", { silent = true })
|
||||
vim.keymap.set("n", "<leader>fg", require("telescope.builtin").live_grep, { silent = true })
|
||||
vim.keymap.set("n", "<leader>fG", my_pickers.live_grep_in_folder, { silent = true })
|
||||
vim.keymap.set("n", "<leader>fb", require("telescope.builtin").current_buffer_fuzzy_find, { silent = true })
|
||||
vim.keymap.set("n", "<leader>fl", require("telescope.builtin").buffers, { silent = true })
|
||||
vim.keymap.set("n", "<leader>fh", require("telescope.builtin").help_tags, { silent = true })
|
||||
vim.keymap.set("n", "<leader>fr", require("telescope.builtin").lsp_references, { silent = true })
|
||||
vim.keymap.set("n", "<leader>fd", require("telescope.builtin").lsp_definitions, { silent = true })
|
||||
vim.keymap.set("n", "<leader>fs", require("telescope.builtin").symbols, { silent = true })
|
||||
vim.keymap.set("n", "<C-p>", require("telescope.builtin").git_status, { silent = true })
|
||||
|
||||
-- Extensions
|
||||
vim.keymap.set("n", "<leader>fm", require("telescope").extensions.media_files.media_files, { silent = true })
|
||||
vim.keymap.set("n", "<leader>ft", require("telescope").extensions.file_browser.file_browser, { silent = true })
|
||||
vim.keymap.set("n", "<leader>fn", require("telescope").extensions.notify.notify, { silent = true })
|
||||
vim.keymap.set("n", "<leader>lb", require("telescope").extensions.dap.list_breakpoints, { silent = true })
|
||||
vim.keymap.set("n", "<leader>lv", require("telescope").extensions.dap.variables, { silent = true })
|
||||
vim.keymap.set("n", "<leader>lf", require("telescope").extensions.dap.frames, { silent = true })
|
||||
vim.keymap.set("n", "<leader>lc", require("telescope").extensions.dap.commands, { silent = true })
|
||||
vim.keymap.set("n", "<leader>ls", require("telescope").extensions.dap.configurations, { silent = true })
|
||||
|
||||
return M
|
@ -0,0 +1,16 @@
|
||||
require("toggleterm").setup({
|
||||
-- size can be a number or function which is passed the current terminal
|
||||
size = 20,
|
||||
open_mapping = [[<c-\>]],
|
||||
hide_numbers = true, -- hide the number column in toggleterm buffers
|
||||
shade_filetypes = {},
|
||||
shade_terminals = true,
|
||||
shading_factor = "1", -- the degree by which to darken to terminal colour, default: 1 for dark backgrounds, 3 for light
|
||||
start_in_insert = true,
|
||||
insert_mappings = true, -- whether or not the open mapping applies in insert mode
|
||||
persist_size = true,
|
||||
direction = "horizontal",
|
||||
close_on_exit = true, -- close the terminal window when the process exits
|
||||
shell = vim.o.shell, -- change the default shell
|
||||
-- This field is only relevant if direction is set to 'float'
|
||||
})
|
@ -0,0 +1,8 @@
|
||||
require("nvim-tree").setup({
|
||||
sync_root_with_cwd = true,
|
||||
respect_buf_cwd = true,
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_root = true
|
||||
},
|
||||
})
|
@ -0,0 +1,232 @@
|
||||
local ts_config = require("nvim-treesitter.configs")
|
||||
|
||||
ts_config.setup({
|
||||
ensure_installed = {
|
||||
"javascript",
|
||||
"typescript",
|
||||
"dockerfile",
|
||||
"tsx",
|
||||
"html",
|
||||
"css",
|
||||
"bash",
|
||||
"lua",
|
||||
"json",
|
||||
"python",
|
||||
"yaml",
|
||||
"go",
|
||||
"gomod",
|
||||
"r",
|
||||
"regex",
|
||||
"latex",
|
||||
"php",
|
||||
"scss",
|
||||
"make",
|
||||
"markdown",
|
||||
"proto",
|
||||
"sql",
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
use_languagetree = true,
|
||||
custom_captures = {
|
||||
-- Highlight the @foo.bar capture group with the "Identifier" highlight group.
|
||||
["function.decorator"] = "TSDecorator",
|
||||
["docstring"] = "TSDocString",
|
||||
},
|
||||
},
|
||||
autopairs = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
|
||||
require("nvim-treesitter.configs").setup({
|
||||
incremental_selection = {
|
||||
enable = enable,
|
||||
keymaps = {
|
||||
-- mappings for incremental selection (visual mappings)
|
||||
init_selection = "gnn", -- maps in normal mode to init the node/scope selection
|
||||
node_incremental = "grn", -- increment to the upper named parent
|
||||
scope_incremental = "grc", -- increment to the upper scope (as defined in locals.scm)
|
||||
node_decremental = "grm", -- decrement to the previous node
|
||||
},
|
||||
},
|
||||
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
config = {
|
||||
go = '// %s',
|
||||
}
|
||||
},
|
||||
|
||||
refactor = {
|
||||
smart_rename = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
smart_rename = "rn",
|
||||
},
|
||||
},
|
||||
highlight_definitions = {
|
||||
enable = true,
|
||||
clear_on_cursor_move = true,
|
||||
},
|
||||
},
|
||||
|
||||
textobjects = {
|
||||
-- syntax-aware textobjects
|
||||
enable = enable,
|
||||
lsp_interop = {
|
||||
enable = enable,
|
||||
peek_definition_code = {
|
||||
["DF"] = "@function.outer",
|
||||
["DF"] = "@class.outer",
|
||||
},
|
||||
},
|
||||
keymaps = {
|
||||
["iL"] = {
|
||||
-- you can define your own textobjects directly here
|
||||
go = "(function_definition) @function",
|
||||
},
|
||||
-- or you use the queries from supported languages with textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["aC"] = "@class.outer",
|
||||
["iC"] = "@class.inner",
|
||||
["ac"] = "@conditional.outer",
|
||||
["ic"] = "@conditional.inner",
|
||||
["ae"] = "@block.outer",
|
||||
["ie"] = "@block.inner",
|
||||
["al"] = "@loop.outer",
|
||||
["il"] = "@loop.inner",
|
||||
["is"] = "@statement.inner",
|
||||
["as"] = "@statement.outer",
|
||||
["ad"] = "@comment.outer",
|
||||
["am"] = "@call.outer",
|
||||
["im"] = "@call.inner",
|
||||
},
|
||||
move = {
|
||||
enable = enable,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
goto_next_start = {
|
||||
["]m"] = "@function.outer",
|
||||
["]]"] = "@class.outer",
|
||||
},
|
||||
goto_next_end = {
|
||||
["]M"] = "@function.outer",
|
||||
["]["] = "@class.outer",
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[m"] = "@function.outer",
|
||||
["[["] = "@class.outer",
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[M"] = "@function.outer",
|
||||
["[]"] = "@class.outer",
|
||||
},
|
||||
},
|
||||
select = {
|
||||
enable = enable,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
-- Or you can define your own textobjects like this
|
||||
["iF"] = {
|
||||
python = "(function_definition) @function",
|
||||
cpp = "(function_definition) @function",
|
||||
c = "(function_definition) @function",
|
||||
java = "(method_declaration) @function",
|
||||
go = "(method_declaration) @function",
|
||||
},
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = enable,
|
||||
swap_next = {
|
||||
["<leader>a"] = "@parameter.inner",
|
||||
},
|
||||
swap_previous = {
|
||||
["<leader>A"] = "@parameter.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("treesitter-context").setup({
|
||||
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
||||
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
|
||||
trim_scope = "outer", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
|
||||
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
|
||||
patterns = { -- Match patterns for TS nodes. These get wrapped to match at word boundaries.
|
||||
-- For all filetypes
|
||||
-- Note that setting an entry here replaces all other patterns for this entry.
|
||||
-- By setting the 'default' entry below, you can control which nodes you want to
|
||||
-- appear in the context window.
|
||||
default = {
|
||||
"class",
|
||||
"function",
|
||||
"method",
|
||||
"for",
|
||||
"while",
|
||||
"if",
|
||||
"switch",
|
||||
"case",
|
||||
},
|
||||
-- Patterns for specific filetypes
|
||||
-- If a pattern is missing, *open a PR* so everyone can benefit.
|
||||
tex = {
|
||||
"chapter",
|
||||
"section",
|
||||
"subsection",
|
||||
"subsubsection",
|
||||
},
|
||||
rust = {
|
||||
"impl_item",
|
||||
"struct",
|
||||
"enum",
|
||||
},
|
||||
scala = {
|
||||
"object_definition",
|
||||
},
|
||||
vhdl = {
|
||||
"process_statement",
|
||||
"architecture_body",
|
||||
"entity_declaration",
|
||||
},
|
||||
markdown = {
|
||||
"section",
|
||||
},
|
||||
elixir = {
|
||||
"anonymous_function",
|
||||
"arguments",
|
||||
"block",
|
||||
"do_block",
|
||||
"list",
|
||||
"map",
|
||||
"tuple",
|
||||
"quoted_content",
|
||||
},
|
||||
json = {
|
||||
"pair",
|
||||
},
|
||||
yaml = {
|
||||
"block_mapping_pair",
|
||||
},
|
||||
},
|
||||
exact_patterns = {
|
||||
-- Example for a specific filetype with Lua patterns
|
||||
-- Treat patterns.rust as a Lua pattern (i.e "^impl_item$" will
|
||||
-- exactly match "impl_item" only)
|
||||
-- rust = true,
|
||||
},
|
||||
|
||||
-- [!] The options below are exposed but shouldn't require your attention,
|
||||
-- you can safely ignore them.
|
||||
|
||||
zindex = 20, -- The Z-index of the context window
|
||||
mode = "topline", -- Line used to calculate context. Choices: 'cursor', 'topline'
|
||||
-- Separator between context and content. Should be a single character string, like '-'.
|
||||
-- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
|
||||
separator = nil,
|
||||
})
|
@ -0,0 +1,84 @@
|
||||
local true_zen = require("true-zen")
|
||||
|
||||
true_zen.setup({
|
||||
modes = { -- configurations per mode
|
||||
ataraxis = {
|
||||
shade = "dark", -- if `dark` then dim the padding windows, otherwise if it's `light` it'll brighten said windows
|
||||
backdrop = 0, -- percentage by which padding windows should be dimmed/brightened. Must be a number between 0 and 1. Set to 0 to keep the same background color
|
||||
minimum_writing_area = { -- minimum size of main window
|
||||
width = 70,
|
||||
height = 44,
|
||||
},
|
||||
quit_untoggles = true, -- type :q or :qa to quit Ataraxis mode
|
||||
padding = { -- padding windows
|
||||
left = 52,
|
||||
right = 52,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
},
|
||||
callbacks = { -- run functions when opening/closing Ataraxis mode
|
||||
open_pre = nil,
|
||||
open_pos = nil,
|
||||
close_pre = nil,
|
||||
close_pos = nil,
|
||||
},
|
||||
},
|
||||
minimalist = {
|
||||
ignored_buf_types = { "nofile" }, -- save current options from any window except ones displaying these kinds of buffers
|
||||
options = { -- options to be disabled when entering Minimalist mode
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
showtabline = 0,
|
||||
signcolumn = "no",
|
||||
statusline = "",
|
||||
cmdheight = 1,
|
||||
laststatus = 0,
|
||||
showcmd = false,
|
||||
showmode = false,
|
||||
ruler = false,
|
||||
numberwidth = 1,
|
||||
},
|
||||
callbacks = { -- run functions when opening/closing Minimalist mode
|
||||
open_pre = nil,
|
||||
open_pos = nil,
|
||||
close_pre = nil,
|
||||
close_pos = nil,
|
||||
},
|
||||
},
|
||||
narrow = {
|
||||
--- change the style of the fold lines. Set it to:
|
||||
--- `informative`: to get nice pre-baked folds
|
||||
--- `invisible`: hide them
|
||||
--- function() end: pass a custom func with your fold lines. See :h foldtext
|
||||
folds_style = "informative",
|
||||
run_ataraxis = true, -- display narrowed text in a Ataraxis session
|
||||
callbacks = { -- run functions when opening/closing Narrow mode
|
||||
open_pre = nil,
|
||||
open_pos = nil,
|
||||
close_pre = nil,
|
||||
close_pos = nil,
|
||||
},
|
||||
},
|
||||
focus = {
|
||||
callbacks = { -- run functions when opening/closing Focus mode
|
||||
open_pre = nil,
|
||||
open_pos = nil,
|
||||
close_pre = nil,
|
||||
close_pos = nil,
|
||||
},
|
||||
},
|
||||
},
|
||||
integrations = {
|
||||
tmux = false, -- hide tmux status bar in (minimalist, ataraxis)
|
||||
kitty = { -- increment font size in Kitty. Note: you must set `allow_remote_control socket-only` and `listen_on unix:/tmp/kitty` in your personal config (ataraxis)
|
||||
enabled = false,
|
||||
font = "+3",
|
||||
},
|
||||
twilight = false, -- enable twilight (ataraxis)
|
||||
lualine = true, -- hide nvim-lualine (ataraxis)
|
||||
},
|
||||
})
|
||||
|
||||
-- toggle truezen.nvim's ataraxis and minimalist mode
|
||||
vim.api.nvim_set_keymap("n", "<leader>z", "<Cmd> TZAtaraxis<CR>", {})
|
||||
vim.api.nvim_set_keymap("n", "<leader>m", "<Cmd> TZMinimalist<CR>", {})
|
@ -0,0 +1,23 @@
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
syn match qfFileName /^[^│]*/ nextgroup=qfSeparatorLeft
|
||||
syn match qfSeparatorLeft /│/ contained nextgroup=qfLineNr
|
||||
syn match qfLineNr /[^│]*/ contained nextgroup=qfSeparatorRight
|
||||
syn match qfSeparatorRight '│' contained nextgroup=qfError,qfWarning,qfInfo,qfNote
|
||||
syn match qfError / E .*$/ contained
|
||||
syn match qfWarning / W .*$/ contained
|
||||
syn match qfInfo / I .*$/ contained
|
||||
syn match qfNote / [NH] .*$/ contained
|
||||
|
||||
hi def link qfFileName NvimTreeFolderName
|
||||
hi def link qfSeparatorLeft Delimiter
|
||||
hi def link qfSeparatorRight Delimiter
|
||||
hi def link qfLineNr LineNr
|
||||
hi def link qfError NvimTreeLspDiagnosticsError
|
||||
hi def link qfWarning NvimTreeLspDiagnosticsWarning
|
||||
hi def link qfInfo NvimTreeLspDiagnosticsInformation
|
||||
hi def link qfNote NvimTreeLspDiagnosticsHint
|
||||
|
||||
let b:current_syntax = 'qf'
|
@ -0,0 +1,22 @@
|
||||
set -g status-style 'bg=#4383a1 fg=#1b1d1e'
|
||||
|
||||
# default theme
|
||||
tmux_conf_theme_colour_1=#1b1d1e # dark gray
|
||||
tmux_conf_theme_colour_2=#6b5c64 # gray
|
||||
tmux_conf_theme_colour_3=#4c7b91 # light gray
|
||||
tmux_conf_theme_colour_4=#90b3c5 # light blue
|
||||
tmux_conf_theme_colour_5=#426b82 # yellow
|
||||
tmux_conf_theme_colour_6=#7e95a2 # dark gray
|
||||
tmux_conf_theme_colour_7=#9cc2d6 # white
|
||||
tmux_conf_theme_colour_8=#c6c6c6 # dark gray
|
||||
tmux_conf_theme_colour_9=#adc7d4 # yellow
|
||||
tmux_conf_theme_colour_10=#976a82 # pink
|
||||
tmux_conf_theme_colour_11=#54a5ca # green
|
||||
tmux_conf_theme_colour_12=#a5efff # light gray
|
||||
tmux_conf_theme_colour_13=#408fbf # white
|
||||
tmux_conf_theme_colour_14=#91c6e5 # dark gray
|
||||
tmux_conf_theme_colour_15=#b2ffff # dark gray
|
||||
tmux_conf_theme_colour_16="#d70000" # red
|
||||
tmux_conf_theme_colour_17=#ffffff # white
|
||||
|
||||
|
@ -0,0 +1,2 @@
|
||||
set -g status-style 'bg=#333333 fg=#5eacd3'
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1 @@
|
||||
run 'cut -c3- ~/.config/tmux/functions.conf | sh -s _apply_configuration'
|
@ -0,0 +1,347 @@
|
||||
# -- windows & pane creation ---------------------------------------------------
|
||||
|
||||
# new window retains current path, possible values are:
|
||||
# - true
|
||||
# - false (default)
|
||||
tmux_conf_new_window_retain_current_path=false
|
||||
|
||||
# new pane retains current path, possible values are:
|
||||
# - true (default)
|
||||
# - false
|
||||
tmux_conf_new_pane_retain_current_path=true
|
||||
|
||||
# new pane tries to reconnect ssh sessions (experimental), possible values are:
|
||||
# - true
|
||||
# - false (default)
|
||||
tmux_conf_new_pane_reconnect_ssh=false
|
||||
|
||||
# prompt for session name when creating a new session, possible values are:
|
||||
# - true
|
||||
# - false (default)
|
||||
tmux_conf_new_session_prompt=false
|
||||
|
||||
|
||||
# -- display -------------------------------------------------------------------
|
||||
|
||||
# RGB 24-bit colour support (tmux >= 2.2), possible values are:
|
||||
# - true
|
||||
# - false (default)
|
||||
tmux_conf_24b_colour=false
|
||||
|
||||
# window style
|
||||
tmux_conf_theme_window_fg="default"
|
||||
tmux_conf_theme_window_bg="default"
|
||||
|
||||
# highlight focused pane (tmux >= 2.1), possible values are:
|
||||
# - true
|
||||
# - false (default)
|
||||
tmux_conf_theme_highlight_focused_pane=false
|
||||
|
||||
# focused pane colours:
|
||||
tmux_conf_theme_focused_pane_bg="$tmux_conf_theme_colour_2"
|
||||
|
||||
# pane border style, possible values are:
|
||||
# - thin (default)
|
||||
# - fat
|
||||
tmux_conf_theme_pane_border_style=thin
|
||||
|
||||
# pane borders colours:
|
||||
tmux_conf_theme_pane_border="$tmux_conf_theme_colour_2"
|
||||
tmux_conf_theme_pane_active_border="$tmux_conf_theme_colour_4"
|
||||
|
||||
# pane indicator colours (when you hit <prefix> + q)
|
||||
tmux_conf_theme_pane_indicator="$tmux_conf_theme_colour_4"
|
||||
tmux_conf_theme_pane_active_indicator="$tmux_conf_theme_colour_4"
|
||||
|
||||
# status line style
|
||||
tmux_conf_theme_message_fg="$tmux_conf_theme_colour_1"
|
||||
tmux_conf_theme_message_bg="$tmux_conf_theme_colour_5"
|
||||
tmux_conf_theme_message_attr="bold"
|
||||
|
||||
# status line command style (<prefix> : Escape)
|
||||
tmux_conf_theme_message_command_fg="$tmux_conf_theme_colour_5"
|
||||
tmux_conf_theme_message_command_bg="$tmux_conf_theme_colour_1"
|
||||
tmux_conf_theme_message_command_attr="bold"
|
||||
|
||||
# window modes style
|
||||
tmux_conf_theme_mode_fg="$tmux_conf_theme_colour_1"
|
||||
tmux_conf_theme_mode_bg="$tmux_conf_theme_colour_5"
|
||||
tmux_conf_theme_mode_attr="bold"
|
||||
|
||||
# status line style
|
||||
tmux_conf_theme_status_fg="$tmux_conf_theme_colour_3"
|
||||
tmux_conf_theme_status_bg="$tmux_conf_theme_colour_1"
|
||||
tmux_conf_theme_status_attr="none"
|
||||
#
|
||||
# terminal title
|
||||
# - built-in variables are:
|
||||
# - #{circled_window_index}
|
||||
# - #{circled_session_name}
|
||||
# - #{hostname}
|
||||
# - #{hostname_ssh}
|
||||
# - #{hostname_full}
|
||||
# - #{hostname_full_ssh}
|
||||
# - #{username}
|
||||
# - #{username_ssh}
|
||||
tmux_conf_theme_terminal_title="#h ❐ #S ● #I #W"
|
||||
|
||||
# window status style
|
||||
# - built-in variables are:
|
||||
# - #{circled_window_index}
|
||||
# - #{circled_session_name}
|
||||
# - #{hostname}
|
||||
# - #{hostname_ssh}
|
||||
# - #{hostname_full}
|
||||
# - #{hostname_full_ssh}
|
||||
# - #{username}
|
||||
# - #{username_ssh}
|
||||
tmux_conf_theme_window_status_fg="$tmux_conf_theme_colour_17"
|
||||
tmux_conf_theme_window_status_bg="$tmux_conf_theme_colour_14"
|
||||
tmux_conf_theme_window_status_attr="none"
|
||||
tmux_conf_theme_window_status_format="#I #W"
|
||||
#tmux_conf_theme_window_status_format="#{circled_window_index} #W"
|
||||
#tmux_conf_theme_window_status_format="#I #W#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}"
|
||||
|
||||
# window current status style
|
||||
# - built-in variables are:
|
||||
# - #{circled_window_index}
|
||||
# - #{circled_session_name}
|
||||
# - #{hostname}
|
||||
# - #{hostname_ssh}
|
||||
# - #{hostname_full}
|
||||
# - #{hostname_full_ssh}
|
||||
# - #{username}
|
||||
# - #{username_ssh}
|
||||
tmux_conf_theme_window_status_current_fg="$tmux_conf_theme_colour_17"
|
||||
tmux_conf_theme_window_status_current_bg="$tmux_conf_theme_colour_4"
|
||||
tmux_conf_theme_window_status_current_attr="bold"
|
||||
tmux_conf_theme_window_status_current_format="#I #W"
|
||||
#tmux_conf_theme_window_status_current_format="#{circled_window_index} #W"
|
||||
#tmux_conf_theme_window_status_current_format="#I #W#{?window_zoomed_flag,🔍,}"
|
||||
|
||||
# window activity status style
|
||||
tmux_conf_theme_window_status_activity_fg="$tmux_conf_theme_colour_17"
|
||||
tmux_conf_theme_window_status_activity_bg="$tmux_conf_theme_colour_14"
|
||||
tmux_conf_theme_window_status_activity_attr="underscore"
|
||||
|
||||
# window bell status style
|
||||
tmux_conf_theme_window_status_bell_fg="$tmux_conf_theme_colour_5"
|
||||
kmux_conf_theme_window_status_bell_bg="default"
|
||||
tmux_conf_theme_window_status_bell_attr="blink,bold"
|
||||
|
||||
# window last status style
|
||||
tmux_conf_theme_window_status_last_fg="$tmux_conf_theme_colour_17"
|
||||
tmux_conf_theme_window_status_last_bg="$tmux_conf_theme_colour_14"
|
||||
tmux_conf_theme_window_status_last_attr="none"
|
||||
|
||||
# status left/right sections separators
|
||||
# tmux_conf_theme_left_separator_main=""
|
||||
# tmux_conf_theme_left_separator_sub="|"
|
||||
# tmux_conf_theme_right_separator_main=""
|
||||
# tmux_conf_theme_right_separator_sub="|"
|
||||
tmux_conf_theme_left_separator_main='\uE0B4' # /!\ you don't need to install Powerline
|
||||
tmux_conf_theme_left_separator_sub='\uE0B5' # you only need fonts patched with
|
||||
tmux_conf_theme_right_separator_main='\uE0B6' # Powerline symbols or the standalone
|
||||
tmux_conf_theme_right_separator_sub='\uE0B7' # PowerlineSymbols.otf font, see README.md
|
||||
|
||||
# status left/right content:
|
||||
# - separate main sections with "|"
|
||||
# - separate subsections with ",
|
||||
# - built-in variables are:
|
||||
# - #{battery_bar}
|
||||
# - #{battery_hbar}
|
||||
# - #{battery_percentage}
|
||||
# - #{battery_status}
|
||||
# - #{battery_vbar}
|
||||
# - #{circled_session_name}
|
||||
# - #{hostname_ssh}
|
||||
# - #{hostname}
|
||||
# - #{hostname_full}
|
||||
# - #{hostname_full_ssh}
|
||||
# - #{loadavg}
|
||||
# - #{mouse}
|
||||
# - #{pairing}
|
||||
# - #{prefix}
|
||||
# - #{root}
|
||||
# - #{synchronized}
|
||||
# - #{uptime_y}
|
||||
# - #{uptime_d} (modulo 365 when #{uptime_y} is used)
|
||||
# - #{uptime_h}
|
||||
# - #{uptime_m}
|
||||
# - #{uptime_s}
|
||||
# - #{username}
|
||||
# - #{username_ssh}
|
||||
tmux_conf_theme_status_left=" #S | #{loadavg}"
|
||||
tmux_conf_theme_status_right=" #{username}#{root} | #{hostname} "
|
||||
|
||||
# status left style
|
||||
tmux_conf_theme_status_left_fg="$tmux_conf_theme_colour_1,$tmux_conf_theme_colour_17"
|
||||
lmux_conf_theme_status_left_bg="$tmux_conf_theme_colour_5,$tmux_conf_theme_colour_10"
|
||||
tmux_conf_theme_status_left_attr="bold,none"
|
||||
|
||||
# status right style
|
||||
tmux_conf_theme_status_right_fg="$tmux_conf_theme_colour_1,$tmux_conf_theme_colour_17"
|
||||
tmux_conf_theme_status_right_bg="$tmux_conf_theme_colour_15,$tmux_conf_theme_colour_4"
|
||||
tmux_conf_theme_status_right_attr="none,bold"
|
||||
|
||||
# pairing indicator
|
||||
tmux_conf_theme_pairing="⚇" # U+2687
|
||||
tmux_conf_theme_pairing_fg="none"
|
||||
tmux_conf_theme_pairing_bg="none"
|
||||
tmux_conf_theme_pairing_attr="none"
|
||||
|
||||
# prefix indicator
|
||||
tmux_conf_theme_prefix="⌨" # U+2328
|
||||
tmux_conf_theme_prefix_fg="none"
|
||||
tmux_conf_theme_prefix_bg="none"
|
||||
tmux_conf_theme_prefix_attr="none"
|
||||
|
||||
# mouse indicator
|
||||
tmux_conf_theme_mouse="↗" # U+2197
|
||||
tmux_conf_theme_mouse_fg="none"
|
||||
tmux_conf_theme_mouse_bg="none"
|
||||
tmux_conf_theme_mouse_attr="none"
|
||||
|
||||
# root indicator
|
||||
tmux_conf_theme_root="!"
|
||||
tmux_conf_theme_root_fg="none"
|
||||
tmux_conf_theme_root_bg="none"
|
||||
tmux_conf_theme_root_attr="bold,blink"
|
||||
|
||||
# synchronized indicator
|
||||
tmux_conf_theme_synchronized="⚏" # U+268F
|
||||
tmux_conf_theme_synchronized_fg="none"
|
||||
tmux_conf_theme_synchronized_bg="none"
|
||||
tmux_conf_theme_synchronized_attr="none"
|
||||
|
||||
# battery bar symbols
|
||||
tmux_conf_battery_bar_symbol_full="◼"
|
||||
tmux_conf_battery_bar_symbol_empty="◻"
|
||||
#tmux_conf_battery_bar_symbol_full="♥"
|
||||
#tmux_conf_battery_bar_symbol_empty="·"
|
||||
|
||||
# battery bar length (in number of symbols), possible values are:
|
||||
# - auto
|
||||
# - a number, e.g. 5
|
||||
tmux_conf_battery_bar_length="auto"
|
||||
|
||||
# battery bar palette, possible values are:
|
||||
# - gradient (default)
|
||||
# - heat
|
||||
# - "colour_full_fg,colour_empty_fg,colour_bg"
|
||||
tmux_conf_battery_bar_palette="gradient"
|
||||
#tmux_conf_battery_bar_palette="#d70000,#e4e4e4,#000000" # red, white, black
|
||||
|
||||
# battery hbar palette, possible values are:
|
||||
# - gradient (default)
|
||||
# - heat
|
||||
# - "colour_low,colour_half,colour_full"
|
||||
tmux_conf_battery_hbar_palette="gradient"
|
||||
#tmux_conf_battery_hbar_palette="#d70000,#ff5f00,#5fff00" # red, orange, green
|
||||
|
||||
# battery vbar palette, possible values are:
|
||||
# - gradient (default)
|
||||
# - heat
|
||||
# - "colour_low,colour_half,colour_full"
|
||||
tmux_conf_battery_vbar_palette="gradient"
|
||||
#tmux_conf_battery_vbar_palette="#d70000,#ff5f00,#5fff00" # red, orange, green
|
||||
|
||||
# symbols used to indicate whether battery is charging or discharging
|
||||
tmux_conf_battery_status_charging="↑" # U+2191
|
||||
tmux_conf_battery_status_discharging="↓" # U+2193
|
||||
#tmux_conf_battery_status_charging="🔌" # U+1F50C
|
||||
#tmux_conf_battery_status_discharging="🔋" # U+1F50B
|
||||
|
||||
# clock style (when you hit <prefix> + t)
|
||||
# you may want to use %I:%M %p in place of %R in tmux_conf_theme_status_right
|
||||
tmux_conf_theme_clock_colour="$tmux_conf_theme_colour_4"
|
||||
tmux_conf_theme_clock_style="24"
|
||||
|
||||
|
||||
# -- clipboard -----------------------------------------------------------------
|
||||
|
||||
# in copy mode, copying selection also copies to the OS clipboard
|
||||
# - true
|
||||
# - false (default)
|
||||
# on macOS, this requires installing reattach-to-user-namespace, see README.md
|
||||
# on Linux, this requires xsel or xclip
|
||||
tmux_conf_copy_to_os_clipboard=false
|
||||
|
||||
|
||||
# -- user customizations -------------------------------------------------------
|
||||
# this is the place to override or undo settings
|
||||
|
||||
# increase history size
|
||||
#set -g history-limit 10000
|
||||
|
||||
# start with mouse mode enabled
|
||||
#set -g mouse on
|
||||
|
||||
# force Vi mode
|
||||
# really you should export VISUAL or EDITOR environment variable, see manual
|
||||
#set -g status-keys vi
|
||||
#set -g mode-keys vi
|
||||
|
||||
# replace C-b by C-a instead of using both prefixes
|
||||
# set -gu prefix2
|
||||
# unbind C-a
|
||||
# unbind C-b
|
||||
# set -g prefix C-a
|
||||
# bind C-a send-prefix
|
||||
|
||||
# move status line to top
|
||||
#set -g status-position top
|
||||
|
||||
# -- tpm -----------------------------------------------------------------------
|
||||
|
||||
# while I don't use tpm myself, many people requested official support so here
|
||||
# is a seamless integration that automatically installs plugins in parallel
|
||||
|
||||
# whenever a plugin introduces a variable to be used in 'status-left' or
|
||||
# 'status-right', you can use it in 'tmux_conf_theme_status_left' and
|
||||
# 'tmux_conf_theme_status_right' variables.
|
||||
|
||||
# by default, launching tmux will update tpm and all plugins
|
||||
# - true (default)
|
||||
# - false
|
||||
tmux_conf_update_plugins_on_launch=true
|
||||
|
||||
# by default, reloading the configuration will update tpm and all plugins
|
||||
# - true (default)
|
||||
# - false
|
||||
tmux_conf_update_plugins_on_reload=true
|
||||
|
||||
# /!\ do not add set -g @plugin 'tmux-plugins/tpm'
|
||||
# /!\ do not add run '~/.tmux/plugins/tpm/tpm'
|
||||
|
||||
# to enable a plugin, use the 'set -g @plugin' syntax:
|
||||
# visit https://github.com/tmux-plugins for available plugins
|
||||
#set -g @plugin 'tmux-plugins/tmux-copycat'
|
||||
#set -g @plujin 'tmux-plugins/tmux-cpu'
|
||||
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
||||
set -g @plugin 'tmux-plugins/tmux-continuum'
|
||||
set -g @continuum-restore 'on'
|
||||
|
||||
|
||||
# -- custom variables ----------------------------------------------------------
|
||||
|
||||
# to define a custom #{foo} variable, define a POSIX shell function between the
|
||||
# '# EOF' and the '# "$@"' lines. Please note that the opening brace { character
|
||||
# must be on the same line as the function name otherwise the parse won't detect
|
||||
# it.
|
||||
#
|
||||
# then, use #{foo} in e.g. the 'tmux_conf_theme_status_left' or the
|
||||
# 'tmux_conf_theme_status_right' variables.
|
||||
#
|
||||
# EOF
|
||||
#
|
||||
# weather() {
|
||||
# curl -m 1 wttr.in?format=3 2>/dev/null
|
||||
# sleep 900 # sleep for 15 minutes, throttle network requests whatever the value of status-interval
|
||||
# }
|
||||
#
|
||||
# online() {
|
||||
# ping -c 1 1.1.1.1 >/dev/null 2>&1 && printf '✔' || printf '✘'
|
||||
# }
|
||||
#
|
||||
# "$@"
|
@ -0,0 +1 @@
|
||||
718afa1f-fd01-4f6b-94b7-682f4f85f3c6
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue