diff options
| author | srdusr <trevorgray@srdusr.com> | 2023-05-01 23:08:26 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2023-05-01 23:08:26 +0200 |
| commit | ba436a9e37e5f4eb0cba05e1b41192a7cef794a3 (patch) | |
| tree | 3e0559371c8a25f1f2fbe2ea38aa73a4043047a9 /.config/nvim/lua | |
| parent | ab246859878ff1d4375f01dbbfe131378c65a541 (diff) | |
| parent | 344cc94d7a8255e74b731b6bc94406958df0cc82 (diff) | |
| download | dotfiles-ba436a9e37e5f4eb0cba05e1b41192a7cef794a3.tar.gz dotfiles-ba436a9e37e5f4eb0cba05e1b41192a7cef794a3.zip | |
Merge commit 'e65568c6a08312766872e054ee62dcdf8b509073'
Diffstat (limited to '.config/nvim/lua')
| -rw-r--r-- | .config/nvim/lua/plugins/colorscheme.lua | 10 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/gitsigns.lua | 8 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/heirline.lua | 212 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/lsp.lua | 6 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/nvim-tree.lua | 57 | ||||
| -rw-r--r-- | .config/nvim/lua/user/opts.lua | 28 |
6 files changed, 124 insertions, 197 deletions
diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua index 2f3782a..1ad9ce8 100644 --- a/.config/nvim/lua/plugins/colorscheme.lua +++ b/.config/nvim/lua/plugins/colorscheme.lua @@ -1,6 +1,6 @@ -- Colorscheme -- Available colorschemes: --- [[ nightfly ayu onedark doom-one ]] +-- [[ nightfly ayu onedark doom-one nvimgelion ]] local colorscheme = "nvimgelion" local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) if not status_ok then @@ -29,10 +29,10 @@ vim.api.nvim_command("highlight CursorLineSign guibg=none ctermbg=NONE") --vim.api.nvim_command("highlight TabLineNC guibg=none gui=bold") --vim.api.nvim_command("highlight StatusLine guibg=#333842 gui=bold") --vim.api.nvim_command("highlight StatusLineNC guibg=none ctermfg=Cyan guifg=#80a0ff gui=bold") ---vim.api.nvim_command("highlight WinSeparator guibg=none gui=bold") ---vim.api.nvim_command("highlight MsgSeparator guibg=none") ---vim.api.nvim_command("highlight PmenuSel guibg=none") ---vim.api.nvim_command("highlight winblend guibg=none") +vim.api.nvim_command("highlight WinSeparator guibg=none gui=bold") +vim.api.nvim_command("highlight MsgSeparator guibg=none") +vim.api.nvim_command("highlight PmenuSel guibg=none") +vim.api.nvim_command("highlight winblend guibg=none") -- Set different window separator colorscheme vim.cmd [[ diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua index dafeece..c7b0726 100644 --- a/.config/nvim/lua/plugins/gitsigns.lua +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -3,25 +3,25 @@ require("gitsigns").setup({ signs = { --add = { -- hl = "GitSignsAdd", - -- text = "│", + -- text = "▍", --│ -- numhl = "GitSignsAddNr", -- linehl = "GitSignsAddLn", --}, --change = { -- hl = "GitSignsChange", - -- text = "│", + -- text = "▍", --│ -- numhl = "GitSignsChangeNr", -- linehl = "GitSignsChangeLn", --}, delete = { hl = "GitSignsDelete", - text = "_", + text = "▁", --_━─ numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn", }, topdelete = { hl = "GitSignsDelete", - text = "‾", + text = "▔", --‾ numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn", }, diff --git a/.config/nvim/lua/plugins/heirline.lua b/.config/nvim/lua/plugins/heirline.lua index caa890c..dc415d5 100644 --- a/.config/nvim/lua/plugins/heirline.lua +++ b/.config/nvim/lua/plugins/heirline.lua @@ -5,7 +5,6 @@ local colors = { --bg = "#23232e", bg = nil, nobg = "NONE", - transparency = "NONE", white = "#f8f8f2", black = "#000000", darkgray = "#23232e", @@ -40,11 +39,6 @@ local Space = { provider = " ", hl = { bg = colors.bg } } local Tab = { provider = " " } local LeftSpace = { provider = "" } local RightSpace = { provider = "" } -local RightSpace2 = { provider = "" } -local RightSpace3 = { provider = "" } -local Fill = { provider = "%=", hl = { bg = colors.nobg } } -local LeftSep = { provider = "" } -local RightSep = { provider = "" } local ViMode = { init = function(self) @@ -96,14 +90,6 @@ local ViMode = { return " %2(" .. self.mode_names[self.mode] .. "%) " end, hl = function(self) return { fg = "darkgray", bg = self.mode_color, bold = true } end, - --hl = function(self) return { fg = self.mode_color, bg = "bg" } end, - -- hl = function(self) - -- local color = self.mode:sub(1, 1) -- get only the first mode character - -- --return { fg = self.mode_colors[mode], bold = true, } - -- --local color = self:mode_color() - -- return { fg = color, bold = true } - -- return { fg = colors.black, bg = color, bold = true } - -- end, update = { "ModeChanged", }, @@ -560,38 +546,7 @@ local help_file_name = { hl = { fg = colors.blue }, } --- Cursor position: Ruler ---local Ruler = { --- %l = current line number --- %L = number of lines in the buffer --- %c = column number --- %P = percentage through file of displayed window ---provider = "%P %(%l/%L%):%c ", ---provider = "%3(%2l%):%c %P ", ---provider = "%7(%l/%3L%):%2c%P ", ---provider = "%3(%P%)", ---provider = "%7(%l/%3L%):%2c %P", ---provider = "%7 %p%% Ln %l, Col %c", ---provider = "%9( %P %2l/%L :%2c %)", ---provider = "%9(%2l%2( : %c%)/%L %P %)", ---provider = "%7(%l:%c/%L%) ", ---provider = "%6(%l:%1.5c/%L%) %P ", ---provider = "%6(%l:%1.5c/%L%) ", ---provider = "%3(%l:%1.5c/%L%) ", ---provider = "%7(%l/%3L%):%2c ", --- provider = "%7(%l:%c%) ", ---provider = "%l:%c ", ---hl = { fg = utils.get_highlight("Statusline").fg, bold = true }, --- hl = { fg = colors.darkgray, bold = true }, ---} -local leftruler = { Space, Align } -local rightruler = { Align, Space } local cursor_location = { - --{ provider = "", hl = { fg = utils.get_highlight("StatusLine").bg, bold = true } }, - -- { provider = "%<%-05.10(%l:%c%)", hl = { fg = colors.darkgray, bold = true } }, - -- { provider = " ", hl = { fg = colors.darkgray, bold = true } }, - --{ provider = "%P %=%<%(%l,%c)" }, - --{ provider = " %w%-8.(%l,%c%)%>" }, { provider = " %1(%4l:%-3(%c%) %)%*", hl = { fg = colors.black, bold = true } }, } local Ruler = { cursor_location } @@ -699,44 +654,13 @@ FileInfoBlock = utils.insert( { provider = "%<" } -- this means that the statusline is cut here when there's not enough space ) ---ViMode = utils.surround({ "", "" }, function(self) --- return self:mode_color() ---end, { ViMode, hl = { fg = utils.get_highlight("statusline").bg, force = true } }) ---local mysurroundedcomponent = { ---{provider='', hl = {...}}, ---{<your component>}, ---{provider = '>>>', hl = {...}} ---} LeftSpace = utils.surround({ "", " " }, function(self) return self:mode_color() end, { LeftSpace, hl = { fg = utils.get_highlight("statusline").bg, force = true } }) -RightSpace = utils.surround({ "", "" }, function(self) +RightSpace = utils.surround({ "", "" }, function(self) return self:mode_color() -end, { RightSpace, hl = { bg = utils.get_highlight("statusline").bg, force = true } }) ---RightSpace = utils.surround( --- { "", "" }, --- colors.gray, --- { RightSpace, hl = { bg = utils.get_highlight("statusline").bg, force = true } } ---) - -RightSpace2 = utils.surround( - { "█", "" }, - colors.darkgray, - { RightSpace2, hl = { fg = colors.darkgray, force = true } } -) - -RightSpace3 = utils.surround( - { "█", "" }, - utils.get_highlight("statusline").bg, - { RightSpace3, hl = { fg = colors.darkgray, force = true } } -) - -RightSpace4 = utils.surround( - { "█", "" }, - utils.get_highlight("statusline").bg, - { RightSpace4, hl = { fg = colors.nobg, force = true } } -) +end, { RightSpace, hl = { fg = utils.get_highlight("statusline").bg, force = true } }) LSPActive = utils.surround({ "", "" }, function(self) return self:mode_color() @@ -750,11 +674,6 @@ Ruler = utils.surround({ "", "" }, colors.gray, { Ruler, hl = { fg = colors.gray local left = { { ViMode, hl = { fg = utils.get_highlight("statusline").bg, force = true } }, - --{ LeftSep, hl = function(self) - -- return { fg = self.mode_colors[self.mode], bg = utils.get_highlight("statusline").bg, bold = true, } - -- end, - --}, - --{ LeftSpace, hl = { bg = utils.get_highlight("statusline").bg, force = true } }, { LeftSpace, hl = { bg = colors.nobg, force = true } }, { FileNameBlock, hl = { bg = colors.nobg, force = true } }, { Space, hl = { bg = colors.nobg, force = true } }, @@ -770,44 +689,20 @@ local right = { { Space, hl = { bg = colors.nobg, force = true } }, { Diagnostics, hl = { bg = colors.nobg, force = true } }, { Space, hl = { bg = colors.nobg, force = true } }, - --{ RightSep, hl = { fg = colors.nobg, bg = colors.nobg, force = true } }, - --{ RightSep, hl = { fg = colors.darkgray, bg = colors.nobg, force = true } }, - --{ - -- RightSpace4, - -- hl = { bg = colors.darkgray, force = true }, - --}, { LSPActive, hl = { bg = colors.nobg, force = true } }, { Space, hl = { bg = colors.nobg, force = true } }, - --{ LSPActive, hl = { bg = colors.darkgray, force = true } }, - --{ RightSpace2, hl = { bg = colors.nobg, force = true } }, - --{ RightSpace2, hl = { bg = colors.gray, force = true } }, { FileInfoBlock, hl = { bg = colors.nobg, force = true } }, - --{ FileInfoBlock, hl = { bg = colors.gray, force = true } }, - --{ RightSep, hl = { bg = colors.nobg, force = true } }, - --{ RightSpace, hl = { bg = colors.nobg, force = true } }, - --{ RightSpace, hl = { fg = colors.gray, force = true } }, - --{ RightSpace, hl = { bg = colors.nobg, force = true } }, - { RightSpace, hl = { bg = colors.nobg, fg = utils.get_highlight("statusline").bg, force = true } }, - --{ cursor_location, hl = { fg = utils.get_highlight("statusline").bg, force = true } }, + { RightSpace, hl = { bg = colors.nobg, force = true } }, { Ruler, hl = { fg = utils.get_highlight("statusline").bg, force = true } }, - --utils.make_flexible_component( - -- 3, - -- { Ruler, hl = { fg = utils.get_highlight("statusline").bg, force = true } }, - -- { provider = "%<" } - --), } ---local Align = { provider = "%=", hl = { bg = colors.bg } } local sections = { left, middle, right } local DefaultStatusline = { sections } ---LSPActive, Space, LSPMessages, Space, UltTest, Space, FileType, Space, Ruler, Space, ScrollBar local InactiveStatusline = { condition = conditions.is_not_active, - { FileType, hl = { bg = utils.get_highlight("statusline").bg, force = true } }, - { Space, hl = { bg = utils.get_highlight("statusline").bg, force = true } }, - { FileName, hl = { bg = utils.get_highlight("statusline").bg, force = true } }, - { Align, hl = { bg = utils.get_highlight("statusline").bg, force = true } }, + { FileNameBlock, hl = { bg = colors.nobg, force = true } }, + { Align, hl = { bg = colors.nobg, force = true } }, } local SpecialStatusline = { @@ -817,14 +712,11 @@ local SpecialStatusline = { filetype = { "^git.*", "fugitive", "dashboard", }, }) end, - --FileType, - --Space, - --Align, { ViMode, hl = { fg = utils.get_highlight("statusline").bg, force = true } }, - { LeftSpace, hl = { bg = utils.get_highlight("statusline").bg, force = true } }, - { Space, hl = { bg = utils.get_highlight("statusline").bg, force = true } }, - { Align, hl = { bg = utils.get_highlight("statusline").bg, force = true } }, - { RightSpace, hl = { fg = utils.get_highlight("statusline").bg, force = true } }, + { LeftSpace, hl = { bg = colors.nobg, force = true } }, + { Space, hl = { bg = colors.nobg, force = true } }, + { Align, hl = { bg = colors.nobg, force = true } }, + { RightSpace, hl = { bg = colors.nobg, force = true } }, { Ruler, hl = { fg = utils.get_highlight("statusline").bg, force = true } }, } @@ -832,31 +724,19 @@ local TerminalStatusline = { condition = function() return conditions.buffer_matches({ buftype = { "terminal" } }) end, - --hl = { bg = colors.red }, -- Quickly add a condition to the ViMode to only show it when buffer is active! --{ condition = conditions.is_active, ViMode, Space }, { ViMode, hl = { fg = utils.get_highlight("statusline").bg, force = true } }, - { LeftSpace, hl = { bg = utils.get_highlight("statusline").bg, force = true } }, - { FileType, hl = { bg = utils.get_highlight("statusline").bg, force = true } }, - { Space, hl = { bg = utils.get_highlight("statusline").bg, force = true } }, - { Align, hl = { bg = utils.get_highlight("statusline").bg, force = true } }, - { RightSpace, hl = { fg = utils.get_highlight("statusline").bg, force = true } }, + { LeftSpace, hl = { bg = colors.nobg, force = true } }, + { FileNameBlock, hl = { bg = colors.nobg, force = true } }, + { Space, hl = { bg = colors.nobg, force = true } }, + { Align, hl = { bg = colors.nobg, force = true } }, + { RightSpace, hl = { bg = colors.nobg, force = true } }, { Ruler, hl = { fg = utils.get_highlight("statusline").bg, force = true } }, - --FileType, - --Space, - --TerminalName, - --Align, } local StatusLine = { - --hl = function() - -- if conditions.is_active() then - -- return "StatusLine" - -- else - -- return "StatusLineNC" - -- end - --end, static = { mode_colors = { n = colors.blue, @@ -900,18 +780,6 @@ local WinbarFileNameBlock = { end, hl = { bg = colors.bg }, } - ---local WinbarFileName = { --- provider = function(self) --- -- self.filename will be defined later, just keep looking at the example! --- local filename = self.filename --- filename = filename == "" and "No Name" or vim.fn.fnamemodify(filename, ":t") --- return filename --- end, --- hl = function() --- return { fg = colors.gray, italic = true } --- end, ---} local WinbarFileName = { provider = function(self) -- first, trim the pattern relative to the current directory. For other @@ -1229,29 +1097,29 @@ require("heirline").setup({ }) -- Yep, with heirline we're driving manual! ---vim.cmd([[au FileType * if index(['wipe', 'delete', 'unload'], &bufhidden) >= 0 | set nobuflisted | endif]]) --- ---local function get_bufs() --- return vim.tbl_filter(function(bufnr) --- return vim.api.nvim_buf_is_loaded(bufnr) and vim.bo[bufnr].buflisted --- end, vim.api.nvim_list_bufs()) ---end --- ---local function goto_buf(index) --- local bufs = get_bufs() --- if index > #bufs then --- index = #bufs --- end --- vim.api.nvim_win_set_buf(0, bufs[index]) ---end --- ---local function addKey(key, index) --- vim.keymap.set("", "<A-" .. key .. ">", function() --- goto_buf(index) --- end, { noremap = true, silent = true }) ---end --- ---for i = 1, 9 do --- addKey(i, i) ---end ---addKey("0", 10) +vim.cmd([[au FileType * if index(['wipe', 'delete', 'unload'], &bufhidden) >= 0 | set nobuflisted | endif]]) + +local function get_bufs() + return vim.tbl_filter(function(bufnr) + return vim.api.nvim_buf_is_loaded(bufnr) and vim.bo[bufnr].buflisted + end, vim.api.nvim_list_bufs()) +end + +local function goto_buf(index) + local bufs = get_bufs() + if index > #bufs then + index = #bufs + end + vim.api.nvim_win_set_buf(0, bufs[index]) +end + +local function addKey(key, index) + vim.keymap.set("", "<A-" .. key .. ">", function() + goto_buf(index) + end, { noremap = true, silent = true }) +end + +for i = 1, 9 do + addKey(i, i) +end +addKey("0", 10) diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index a4127e3..6c40c9c 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -169,17 +169,17 @@ local servers = { settings = { Lua = { runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) version = "LuaJIT", + path = vim.split(package.path, ';'), }, diagnostics = { - -- Get the language server to recognize the `vim` global + enable = true, globals = { "vim" }, }, workspace = { - -- Make the server aware of Neovim runtime files, maxPreload = 2000, preloadFileSize = 50000, + checkThirdParty = false, }, }, }, diff --git a/.config/nvim/lua/plugins/nvim-tree.lua b/.config/nvim/lua/plugins/nvim-tree.lua index e6cf73c..a1731ff 100644 --- a/.config/nvim/lua/plugins/nvim-tree.lua +++ b/.config/nvim/lua/plugins/nvim-tree.lua @@ -25,6 +25,9 @@ nvim_tree.setup({ }, renderer = { root_folder_modifier = ":t", + indent_markers = { + enable = true, + }, icons = { glyphs = { default = "", @@ -75,3 +78,57 @@ nvim_tree.setup({ --}, }, }) + +-- Highlight Groups +vim.api.nvim_command("highlight NvimTreeNormal guibg=none") +--vim.api.nvim_command("highlight NvimTreeSymlink ") +--vim.api.nvim_command("highlight NvimTreeSymlinkFolderName ") --(Directory) +--vim.api.nvim_command("highlight NvimTreeFolderName ") --(Directory) +--vim.api.nvim_command("highlight NvimTreeRootFolder ") +--vim.api.nvim_command("highlight NvimTreeFolderIcon ") +--vim.api.nvim_command("highlight NvimTreeOpenedFolderIcon ") --(NvimTreeFolderIcon) +--vim.api.nvim_command("highlight NvimTreeClosedFolderIcon ") --(NvimTreeFolderIcon) +--vim.api.nvim_command("highlight NvimTreeFileIcon ") +--vim.api.nvim_command("highlight NvimTreeEmptyFolderName ") --(Directory) +--vim.api.nvim_command("highlight NvimTreeOpenedFolderName ") --(Directory) +--vim.api.nvim_command("highlight NvimTreeExecFile ") +--vim.api.nvim_command("highlight NvimTreeOpenedFile ") +--vim.api.nvim_command("highlight NvimTreeModifiedFile ") +--vim.api.nvim_command("highlight NvimTreeSpecialFile ") +--vim.api.nvim_command("highlight NvimTreeImageFile ") +--vim.api.nvim_command("highlight NvimTreeIndentMarker ") +--vim.api.nvim_command("highlight NvimTreeLspDiagnosticsError ") --(DiagnosticError) +--vim.api.nvim_command("highlight NvimTreeLspDiagnosticsWarning ") --(DiagnosticWarn) +--vim.api.nvim_command("highlight NvimTreeLspDiagnosticsInformation ") --(DiagnosticInfo) +--vim.api.nvim_command("highlight NvimTreeLspDiagnosticsHint ") --(DiagnosticHint) +--vim.api.nvim_command("highlight NvimTreeGitDirty ") +--vim.api.nvim_command("highlight NvimTreeGitStaged ") +--vim.api.nvim_command("highlight NvimTreeGitMerge ") +--vim.api.nvim_command("highlight NvimTreeGitRenamed ") +--vim.api.nvim_command("highlight NvimTreeGitNew ") +--vim.api.nvim_command("highlight NvimTreeGitDeleted ") +--vim.api.nvim_command("highlight NvimTreeGitIgnored ") --(Comment) +--vim.api.nvim_command("highlight NvimTreeWindowPicker ") +--vim.api.nvim_command("highlight NvimTreeNormal ") +--vim.api.nvim_command("highlight NvimTreeEndOfBuffer ") --(NonText) +--vim.api.nvim_command("highlight NvimTreeCursorLine ") --(CursorLine) +--vim.api.nvim_command("highlight NvimTreeCursorLineNr ") --(CursorLineNr) +--vim.api.nvim_command("highlight NvimTreeLineNr ") --(LineNr) +--vim.api.nvim_command("highlight NvimTreeWinSeparator ") --(WinSeparator) +--vim.api.nvim_command("highlight NvimTreeCursorColumn ") --(CursorColumn) + + +--vim.api.nvim_command("highlight NvimTreeFileDirty ") --(NvimTreeGitDirty) +--vim.api.nvim_command("highlight NvimTreeFileStaged ") --(NvimTreeGitStaged) +--vim.api.nvim_command("highlight NvimTreeFileMerge ") --(NvimTreeGitMerge) +--vim.api.nvim_command("highlight NvimTreeFileRenamed ") --(NvimTreeGitRenamed) +--vim.api.nvim_command("highlight NvimTreeFileNew ") --(NvimTreeGitNew) +--vim.api.nvim_command("highlight NvimTreeFileDeleted ") --(NvimTreeGitDeleted) +--vim.api.nvim_command("highlight NvimTreeFileIgnored ") --(NvimTreeGitIgnored) + + +--vim.api.nvim_command("highlight NvimTreeLiveFilterPrefix ") +--vim.api.nvim_command("highlight NvimTreeLiveFilterValue ") + + +--vim.api.nvim_command("highlight NvimTreeBookmark ") diff --git a/.config/nvim/lua/user/opts.lua b/.config/nvim/lua/user/opts.lua index 78a84a4..aa4d0c2 100644 --- a/.config/nvim/lua/user/opts.lua +++ b/.config/nvim/lua/user/opts.lua @@ -172,20 +172,22 @@ vim.opt.shortmess:append("sI") --vim.opt.shortmess = "sI" --vim.o.shortmess = vim.o.shortmess:gsub('s', '') vim.opt.fillchars = { - horiz = "━", - horizup = "┻", - horizdown = "┳", - vert = "┃", - vertleft = "┨", - vertright = "┣", - verthoriz = "╋", - fold = "⠀", + horiz = "─", + horizup = "┴", + horizdown = "┬", + vert = "│", + vertleft = "┤", + vertright = "├", + verthoriz = "┼", + foldopen = "", + foldsep = "│", + foldclose = "", + fold = "─", eob = " ", - diff = "┃", - msgsep = "‾", - foldopen = "▾", - foldsep = "│", - foldclose = "▸", + --diff = "┃", + diff = "░", + msgsep = "━", + --msgsep = "‾", } vim.opt.listchars = { tab = "▸ ", trail = "·" } -- --vim.opt.fillchars:append({ eob = " " }) -- remove the ~ from end of buffer |
