From 139a15c96c14b0978d5a440aff0df8e8e1cd2268 Mon Sep 17 00:00:00 2001 From: srdusr Date: Fri, 19 May 2023 10:57:10 +0200 Subject: Troubleshooting dashboard causing freeze --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 8c146b0..0b2a52e 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ local modules = { "plugins.dap", "plugins.neotest", "plugins.heirline", - "plugins.dashboard", + --"plugins.dashboard", } -- cgit v1.2.3 From cd51bc4a0d786366e508a2af8ba9aa3e1325fd63 Mon Sep 17 00:00:00 2001 From: srdusr Date: Fri, 19 May 2023 23:06:32 +0200 Subject: Installed colorscheme projekt0n/github-nvim-theme --- lua/user/pack.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/user/pack.lua b/lua/user/pack.lua index c45517d..af5818c 100644 --- a/lua/user/pack.lua +++ b/lua/user/pack.lua @@ -217,6 +217,7 @@ return packer.startup(function(use) use("joshdick/onedark.vim") use("NTBBloodbath/doom-one.nvim") use("nyngwang/nvimgelion") + use("projekt0n/github-nvim-theme") -- UI use("kyazdani42/nvim-web-devicons") -- -- cgit v1.2.3 From 27d67a91029c673e63833dc60bf67df521b8d460 Mon Sep 17 00:00:00 2001 From: srdusr Date: Fri, 19 May 2023 23:06:49 +0200 Subject: Re-enabled dashboard --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 0b2a52e..8c146b0 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ local modules = { "plugins.dap", "plugins.neotest", "plugins.heirline", - --"plugins.dashboard", + "plugins.dashboard", } -- cgit v1.2.3 From a8dfd609677dc5ec643111b9a91f202616dff472 Mon Sep 17 00:00:00 2001 From: srdusr Date: Fri, 19 May 2023 23:09:44 +0200 Subject: Changed colorscheme to github_dark --- lua/plugins/colorscheme.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index 2735204..b8a9dca 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -1,7 +1,7 @@ -- Colorscheme -- Available colorschemes: --- [[ nightfly ayu onedark doom-one nvimgelion ]] -local colorscheme = "doom-one" +-- [[ nightfly ayu onedark doom-one nvimgelion github_dark ]] +local colorscheme = "github_dark" local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) if not status_ok then vim.notify("colorscheme " .. colorscheme .. " not found!") -- cgit v1.2.3 From b9336ef88b0653baea398ad447ee9f4e2da5bce1 Mon Sep 17 00:00:00 2001 From: srdusr Date: Sat, 20 May 2023 20:17:01 +0200 Subject: Removed plugin.colorizer and call it from pack.lua --- init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 8c146b0..76547ff 100644 --- a/init.lua +++ b/init.lua @@ -74,7 +74,7 @@ local modules = { "plugins.cmp", "plugins.quickfix", "plugins.snippets", - "plugins.colorizer", + --"plugins.colorizer", "plugins.prettier", --"plugins.git", "plugins.lsp", @@ -92,6 +92,7 @@ local modules = { "plugins.neotest", "plugins.heirline", "plugins.dashboard", + --"plugins.modify-blend", } -- cgit v1.2.3 From 6e220ed36c74cc417d4ba81ef131826cc2f3c125 Mon Sep 17 00:00:00 2001 From: srdusr Date: Sat, 20 May 2023 20:17:38 +0200 Subject: Moved colorizser to only have config here --- lua/user/pack.lua | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/lua/user/pack.lua b/lua/user/pack.lua index af5818c..256503e 100644 --- a/lua/user/pack.lua +++ b/lua/user/pack.lua @@ -133,9 +133,23 @@ return packer.startup(function(use) use("kyazdani42/nvim-tree.lua") -- File explorer use('ibhagwan/fzf-lua') -- Fuzzy finder use('ThePrimeagen/harpoon') - use("nvim-telescope/telescope.nvim") -- Fuzzy finder with lots of features/extendabilities + --use("nvim-telescope/telescope.nvim") -- Fuzzy finder with lots of features/extendabilities + use({ + 'nvim-telescope/telescope.nvim', + branch = '0.1.x', + --config = function() + -- require('plugins.telescope').setup() + --end, + requires = { + 'nvim-lua/plenary.nvim', + 'nvim-telescope/telescope-live-grep-args.nvim', + 'nvim-telescope/telescope-file-browser.nvim', + { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }, + } + }) use({ "nvim-telescope/telescope-fzf-native.nvim", run = "make" }) -- Support fzf syntax/algorithm use("nvim-telescope/telescope-ui-select.nvim") -- + use("nvim-telescope/telescope-project.nvim") -- use("nvim-telescope/telescope-media-files.nvim") -- use("nvim-telescope/telescope-file-browser.nvim") -- use({ "nvim-telescope/telescope-symbols.nvim", after = "telescope.nvim" }) -- Search emoji(s) and other symbols @@ -238,13 +252,30 @@ return packer.startup(function(use) }) use({ 'glepnir/dashboard-nvim', - event = 'VimEnter', + --event = 'VimEnter', requires = {'nvim-tree/nvim-web-devicons'} }) use("rcarriga/nvim-notify") -- Notification plugin use("karb94/neoscroll.nvim") -- Faster/smooth scrolling use("MunifTanjim/prettier.nvim") -- Prettier plugin for Neovim's built-in LSP client - use("norcalli/nvim-colorizer.lua") -- + use({ + 'norcalli/nvim-colorizer.lua', -- colorize hexa and rgb strings + cmd = { 'ColorizerToggle', 'ColorizerAttachToBuffer' }, + config = function() + require('colorizer').setup({ + --'*'; + user_default_options = { + RGB = true, + RRGGBB = true, + names = false, + RRGGBBAA = false, + css = false, + css_fn = true, + mode = 'foreground', + }, + }) + end + }) use( "j-hui/fidget.nvim") -- UI to show nvim-lsp progress use { "simrat39/symbols-outline.nvim", -- config = function() @@ -262,8 +293,8 @@ return packer.startup(function(use) }) use({ 'rebelot/heirline.nvim', -- Statusline that is highly configurable - requires = 'kyazdani42/nvim-web-devicons', - event = 'VimEnter', + --requires = 'kyazdani42/nvim-web-devicons', + --event = 'VimEnter', }) -- Language specific tools -- cgit v1.2.3 From 78f6e9ff85dddd890135a188f69785a81813d09f Mon Sep 17 00:00:00 2001 From: srdusr Date: Sat, 20 May 2023 20:18:15 +0200 Subject: Made a startup telescope in current dir --- lua/plugins/telescope.lua | 139 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 106 insertions(+), 33 deletions(-) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 9c72dcf..6e8745c 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -1,13 +1,14 @@ local M = {} + -- Shorten function names local actions = require("telescope.actions") local fb_actions = require("telescope").extensions.file_browser.actions -local builtin = require("telescope.builtin") -local themes = require("telescope.themes") -local utils = require("telescope.utils") -local action_state = require("telescope.actions.state") -local layout_actions = require("telescope.actions.layout") - +--local builtin = require("telescope.builtin") +--local themes = require("telescope.themes") +--local utils = require("telescope.utils") +--local action_state = require("telescope.actions.state") +--local layout_actions = require("telescope.actions.layout") +--local pickers = require("telescope.pickers") require('telescope').setup({ defaults = { @@ -23,28 +24,29 @@ require('telescope').setup({ "--fixed-strings", "--trim", }, - prompt_prefix = " ", - selection_caret = " ", - entry_prefix = " ", - path_display = { "tail" }, + prompt_prefix = " ", + selection_caret = " ", + entry_prefix = " ", + path_display = { "tail" }, --path_display = { "truncate" }, - --path_display = { "smart" }, - file_ignore_patterns = { - "packer_compiled.lua", - "%.DS_Store", - "%.git/", - "%.spl", - --"%.log", - "%[No Name%]", -- new files / sometimes folders (netrw) - "/$", -- ignore folders (netrw) - "node_modules", - "%.png", - "%.zip", - "%.pxd", + --path_display = { "smart" }, + file_ignore_patterns = { + "packer_compiled.lua", + "%.DS_Store", + "%.git/", + "%.spl", + --"%.log", + "%[No Name%]", -- new files / sometimes folders (netrw) + "/$", -- ignore folders (netrw) + "node_modules", + "%.png", + "%.zip", + "%.pxd", "^.vim/", "^.local/", "^.cache/", "^downloads/", + "^music/", --"^node_modules/", --"^undodir/", }, @@ -153,16 +155,16 @@ require('telescope').setup({ prompt_position = "bottom", }, }, - pickers = { - live_grep = { - disable_coordinates = true, - layout_config = { - horizontal = { - preview_width = 0.55, - }, - }, - }, - }, + --pickers = { + -- live_grep = { + -- disable_coordinates = true, + -- layout_config = { + -- horizontal = { + -- preview_width = 0.55, + -- }, + -- }, + -- }, + --}, --pickers = { --lsp_references = { -- prompt_prefix='⬅️', @@ -371,4 +373,75 @@ function M.grep_current_dir() require("telescope.builtin").live_grep(opts) end +-------------------------------------------------------------------------------- + +local dropdown = require('telescope.themes').get_dropdown({ + hidden = true, + no_ignore = true, + previewer = false, + prompt_title = '', + preview_title = '', + results_title = '', + layout_config = { + --anchor = "S", + prompt_position = 'top' + }, +}) + +-- File browser always relative to buffer +local opts_file_browser = vim.tbl_extend('force', dropdown, { + path_display = { '%:p:h' }, +}) + +-- Set current folder as prompt title +local with_title = function(opts, extra) + extra = extra or {} + local path = opts.cwd or opts.path or extra.cwd or extra.path or nil + local title = '' + local buf_path = vim.fn.expand('%:p:h') + local cwd = vim.fn.getcwd() + if path ~= nil and buf_path ~= cwd then + title = require('plenary.path'):new(buf_path):make_relative(cwd) + else + title = vim.fn.fnamemodify(cwd, ':t') + end + + return vim.tbl_extend('force', opts, { + prompt_title = title + }, extra or {}) +end + +--vim.api.nvim_create_augroup('startup', { clear = true }) +--vim.api.nvim_command('augroup startup') +--vim.api.nvim_command('autocmd!') +--vim.api.nvim_command('autocmd VimEnter * lua require("plugins/telescope").startup()') +--vim.api.nvim_command('augroup END') + + +local startup = function() + -- Open file browser if argument is a folder + local arg = vim.api.nvim_eval('argv(0)') + if arg and (vim.fn.isdirectory(arg) ~= 0 or arg == "") then + vim.defer_fn(function() + require('telescope.builtin').find_files(with_title(dropdown)) +-- require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ +-- hidden = true, +-- results_title = '', +-- layout_config = { prompt_position = 'top' }, +-- })) + end, 10) + end +end + + + +-- Define the custom command startup/findhere +vim.cmd('command! Startup lua require("plugins.telescope").startup()') +vim.cmd('command! Findhere lua require("plugins.telescope").startup()') + +--vim.api.nvim_command('autocmd VimEnter * lua require("plugins/telescope").startup()') + +-- Merge the existing M table with the startup function table +M = vim.tbl_extend('force', M, { startup = startup }) + return M -- cgit v1.2.3 From f136e925970e9f2e11decc76e022f5bcc8996f19 Mon Sep 17 00:00:00 2001 From: srdusr Date: Sat, 20 May 2023 20:18:29 +0200 Subject: Changed back to doom-one --- lua/plugins/colorscheme.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index b8a9dca..88a1de6 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -1,7 +1,7 @@ -- Colorscheme -- Available colorschemes: -- [[ nightfly ayu onedark doom-one nvimgelion github_dark ]] -local colorscheme = "github_dark" +local colorscheme = "doom-one" local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) if not status_ok then vim.notify("colorscheme " .. colorscheme .. " not found!") -- cgit v1.2.3 From 522bb53ceb72c35e0d1d2295da1407e3e38460ae Mon Sep 17 00:00:00 2001 From: srdusr Date: Sat, 20 May 2023 20:18:56 +0200 Subject: Removed colorizer config and moved to pack.lua --- lua/plugins/colorizer.lua | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 lua/plugins/colorizer.lua diff --git a/lua/plugins/colorizer.lua b/lua/plugins/colorizer.lua deleted file mode 100644 index 14d25e2..0000000 --- a/lua/plugins/colorizer.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status, colorizer = pcall(require, "colorizer") -if (not status) then return end - -colorizer.setup({ - '*'; -}) -- cgit v1.2.3 From bda51b7d4788d6776595ad341aa307809a816026 Mon Sep 17 00:00:00 2001 From: srdusr Date: Sat, 20 May 2023 20:42:40 +0200 Subject: Attempt to not have colorschemes override highlights --- lua/plugins/colorscheme.lua | 309 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 309 insertions(+) diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index 88a1de6..4be9a7e 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -8,6 +8,23 @@ if not status_ok then return end +--local function MyHighlights() +-- vim.cmd('highlight Visual cterm=NONE ctermbg=76 ctermfg=16 gui=NONE guibg=#5fd700 guifg=#000000') +-- vim.cmd('highlight StatusLine cterm=NONE ctermbg=231 ctermfg=160 gui=NONE guibg=#ffffff guifg=#d70000') +-- vim.cmd('highlight Normal cterm=NONE ctermbg=17 gui=NONE guibg=#00005f') +-- vim.cmd('highlight NonText cterm=NONE ctermbg=17 gui=NONE guibg=#00005f') +--end +-- +--local function setupMyColors() +-- vim.cmd('augroup MyColors') +-- vim.cmd('autocmd!') +-- vim.cmd('autocmd ColorScheme * call v:lua.MyHighlights()') +-- vim.cmd('augroup END') +--end +-- +--setupMyColors() + + vim.api.nvim_command("syntax on") vim.api.nvim_command("highlight Normal guibg=none") vim.api.nvim_command("highlight SignColumn guibg=none") @@ -70,3 +87,295 @@ require("notify").setup({ -- "highlight TabLineSel guifg=#FA7F7F -- highlight MatchParen gui=bold guibg=black guifg=limegreen --]]) +--local colors = { +-- background = '#1c1c1c', +-- foreground = '#cacaca', +-- accent = '#fe5186', +-- blue = '#61afef', +-- cyan = '#3e8fb0', +-- dark_green = '#5faf5f', +-- dark_grey = '#222222', +-- dark_orange = '#ff5d62', +-- dark_red = '#bf1131', +-- dark_yellow = '#ffaf00', +-- green = '#98c379', +-- grey = '#2a2a2a', +-- light_grey = '#727169', +-- light_orange = '#ffa066', +-- light_pink = '#e46876', +-- light_yellow = '#e6db74', +-- magenta = '#c678dd', +-- orange = '#ff8700', +-- purple = '#af87d7', +-- red = '#c4384b', +-- violet = '#a9a1e1', +-- white = '#e3e3e3', +-- yellow = '#d7af5f', +--} +---- Base highlights to override themes to my preferences +--local base = { +-- CursorLine = { bg = 'none', fg = 'none' }, +-- -- Avoid changing the foreground color from the main theme +-- MatchParen = { fg = colors.accent, bg = 'none', bold = true }, +-- Visual = { bg = colors.grey, fg = 'none' }, +-- ActionPreviewBorder = { link = 'XMenuBorder' }, +-- ActionPreviewNormal = { link = 'XMenu' }, +-- CallHierarchyBorder = { link = 'XMenuBorder' }, +-- CallHierarchyNormal = { link = 'XMenu' }, +-- CodeActionBorder = { link = 'XMenuBorder' }, +-- CodeActionNormal = { link = 'XMenu' }, +-- DefinitionBorder = { link = 'XMenuBorder' }, +-- DefinitionNormal = { link = 'XMenu' }, +-- EndOfBuffer = { fg = colors.background }, +-- FinderBorder = { link = 'XMenuBorder' }, +-- FinderNormal = { link = 'XMenu' }, +-- FloatBorder = { link = 'XMenuBorder' }, +-- FloatNormal = { link = 'XMenu' }, +-- HoverBorder = { link = 'XMenuBorder' }, +-- HoverNormal = { link = 'XMenu' }, +-- NormalFloat = { link = 'XMenu' }, +-- OutlinePreviewBorder = { link = 'XMenuBorder' }, +-- OutlinePreviewNormal = { link = 'XMenu' }, +-- Pmenu = { link = 'XMenu' }, +-- RenameBorder = { link = 'XMenuBorder' }, +-- RenameNormal = { link = 'XMenu' }, +-- TerminalBorder = { link = 'XMenuBorder' }, +-- TerminalNormal = { link = 'XMenu' }, +-- Todo = { fg = colors.orange, bold = true }, +-- SagaNormal = { link = 'XMenu' }, +-- SagaBorder = { link = 'XMenuBorder' }, +-- StatusLine = { bg = colors.background, fg = colors.foreground }, +-- TitleString = { link = 'XMenu' }, +-- TitleIcon = { link = 'XMenu' }, +-- ActionPreviewTitle = { link = 'XMenu' }, +-- -- Mason +-- MasonHeader = { link = 'XMenu' }, +-- MasonNormal = { link = 'XMenu' }, +-- NvimTreeCursorColumn = { bg = 'none', fg = 'none' }, +-- --NvimTreeCursorLine = { bg = colors.dark_grey, fg = colors.accent }, +-- -- Telescope +-- TelescopeBorder = { link = 'XMenuBorder' }, +-- TelescopePromptBorder = { link = 'XMenuBorder' }, +-- TelescopePromptNormal = { link = 'XMenu', fg = colors.foreground }, +-- TelescopePromptPrefix = { link = 'XMenu', fg = colors.foreground }, +-- TelescopeNormal = { bg = colors.background }, +-- TelescopePreviewBorder = { link = 'XMenuBorder' }, +-- TelescopePreviewNormal = { link = 'XMenu', fg = colors.foreground }, +-- TelescopePreviewTitle = { fg = colors.background, bg = colors.light_orange }, +-- TelescopePreviewLine = { fg = colors.background, bg = colors.orange }, +-- TelescopePromptTitle = { fg = colors.background, bg = colors.light_orange }, +-- TelescopeResultsTitle = { fg = colors.background, bg = colors.light_orange }, +-- TelescopeResultsBorder = { link = 'XMenuBorder' }, +-- TelescopeResultsNormal = { link = 'XMenu' }, +--} +-- +--local theme = { +-- -- Transparent background +-- Conceal = { bg = 'none', fg = colors.foreground }, +-- FoldCoumn = { bg = 'none' }, +-- LineNr = { bg = 'none', fg = colors.grey }, +-- MsgArea = { bg = 'none', fg = colors.foreground }, +-- NonText = { bg = 'none', fg = colors.light_grey }, +-- Normal = { bg = 'none', fg = colors.foreground }, +-- NormalNC = { bg = 'none', fg = colors.foreground }, +-- SignColumn = { bg = 'none' }, +-- WinSeparator = { bg = 'none', fg = colors.grey }, +-- -- Language Syntax +-- Boolean = { fg = colors.grey }, +-- Character = { fg = colors.yellow }, +-- Comment = { fg = colors.light_grey }, +-- Conditional = { fg = colors.blue }, +-- Constant = { fg = colors.grey }, +-- Debug = { fg = colors.green }, +-- Define = { fg = colors.green }, +-- Delimiter = { fg = colors.grey }, +-- Error = { fg = colors.red }, +-- Exception = { fg = colors.dark_orange }, +-- Float = { fg = colors.light_pink }, +-- Function = { fg = colors.foreground }, +-- Identifier = { fg = colors.foreground }, +-- Ignore = { fg = colors.light_grey }, +-- Include = { fg = colors.dark_orange }, +-- Keyword = { fg = colors.blue }, +-- Label = { fg = colors.grey }, +-- Macro = { fg = colors.dark_orange }, +-- Number = { fg = colors.light_pink }, +-- Operator = { fg = colors.purple }, +-- PreCondit = { fg = colors.dark_orange }, +-- PreProc = { fg = colors.dark_orange }, +-- Repeat = { fg = colors.blue }, +-- Special = { fg = colors.dark_orange }, +-- SpecialChar = { fg = colors.dark_orange }, +-- SpecialComment = { fg = colors.orange }, +-- Statement = { fg = colors.blue }, +-- StorageClass = { fg = colors.light_orange }, +-- String = { fg = colors.yellow }, +-- Structure = { fg = colors.light_orange }, +-- Tag = { fg = colors.orange }, +-- Todo = { fg = colors.orange, bold = true }, +-- Type = { fg = colors.light_orange }, +-- Typedef = { fg = colors.foreground }, +-- Underlined = { fg = colors.foreground }, +-- -- Rest +-- ColorColumn = { bg = colors.dark_grey }, +-- Cursor = { bg = colors.accent }, +-- CursorColumn = { bg = 'none', fg = colors.accent }, +-- CursorLine = { bg = 'none', fg = 'none' }, +-- CursorLineNr = { bg = 'none', fg = colors.light_pink }, +-- Directory = { fg = colors.cyan, bold = true }, +-- ErrorMsg = { bg = 'none', fg = colors.red }, +-- IncSearch = { bg = colors.accent, fg = colors.foreground }, +-- MatchParen = { fg = colors.accent, bg = 'none', bold = true }, +-- Search = { bg = colors.accent }, +-- SpellBad = { bg = 'none', fg = 'none', undercurl = true, ctermbg = 'none', ctermfg = 'none' }, +-- SpellLocal = { bg = 'none', fg = 'none', undercurl = true, ctermbg = 'none', ctermfg = 'none' }, +-- SpellRare = { bg = 'none', fg = 'none', undercurl = true, ctermbg = 'none', ctermfg = 'none' }, +-- StatusLine = { fg = colors.foreground, bg = 'none' }, +-- StatusLineNC = { fg = 'none', bg = 'none' }, +-- Title = { fg = colors.blue, bg = '', bold = true }, +-- VertSplit = { bg = 'none', fg = colors.grey }, +-- Visual = { bg = colors.grey, fg = 'none' }, +-- -- Diagnostic +-- DiagnosticBorder = { link = 'XMenuBorder' }, +-- DiagnosticNormal = { link = 'XMenu' }, +-- DiagnosticError = { fg = colors.red }, +-- DiagnosticFloatingError = { link = 'XMenu' }, +-- DiagnosticFloatingHint = { link = 'XMenu' }, +-- DiagnosticFloatingInfo = { link = 'XMenu' }, +-- DiagnosticFloatingWarn = { link = 'XMenu' }, +-- DiagnosticSignHint = { fg = colors.grey, bold = true, bg = 'none' }, +-- DiagnosticUnderlineError = { undercurl = true }, +-- DiagnosticVirtualTextHint = { bg = 'none' }, +-- DiagnosticWarn = { fg = colors.yellow }, +-- -- nvim cmp +-- CmpItemAbbr = { fg = colors.foreground }, +-- CmpItemAbbrMatch = { fg = colors.dark_orange }, +-- CmpItemAbbrMatchFuzzy = { fg = colors.dark_orange }, +-- CmpBorder = { link = 'FloatBorder' }, +-- CmpDocBorder = { link = 'FloatBorder' }, +-- CmpItemMenuDefault = { link = 'NormalFloat' }, +-- CmpMenu = { link = 'NormalFloat' }, +-- -- cmp item kinds +-- CmpItemKindConstant = { fg = colors.light_pink }, +-- CmpItemKindFunction = { fg = colors.blue }, +-- CmpItemKindIdentifier = { fg = colors.purple }, +-- CmpItemKindField = { fg = colors.dark_orange }, +-- CmpItemKindVariable = { fg = colors.purple }, +-- CmpItemKindSnippet = { fg = colors.light_pink }, +-- CmpItemKindText = { fg = colors.foreground }, +-- CmpItemKindStructure = { fg = colors.blue }, +-- CmpItemKindType = { fg = colors.orange }, +-- CmpItemKindKeyword = { fg = colors.blue }, +-- CmpItemKindMethod = { fg = colors.purple }, +-- CmpItemKindConstructor = { fg = colors.blue }, +-- CmpItemKindFolder = { fg = colors.blue }, +-- CmpItemKindModule = { fg = colors.dark_orange }, +-- CmpItemKindProperty = { fg = colors.dark_orange }, +-- CmpItemKindEnum = { fg = colors.blue }, +-- CmpItemKindUnit = { fg = colors.green }, +-- CmpItemKindClass = { fg = colors.blue }, +-- CmpItemKindFile = { fg = colors.blue }, +-- CmpItemKindInterface = { fg = colors.blue }, +-- CmpItemKindColor = { fg = colors.yellow }, +-- CmpItemKindReference = { fg = colors.blue }, +-- CmpItemKindEnumMember = { fg = colors.green }, +-- CmpItemKindStruct = { fg = colors.blue }, +-- -- CmpItemKindValue = { fg = "" }, +-- -- CmpItemKindEvent = { fg = "" }, +-- CmpItemKindOperator = { fg = colors.purple }, +-- CmpItemKindTypeParameter = { fg = colors.light_pink }, +-- CmpItemKindCopilot = { fg = colors.green }, +-- -- LSPSaga +-- OutlinePreviewBorder = { link = 'NormalFloat' }, +-- OutlinePreviewNormal = { link = 'FloatBorder' }, +-- -- Diffview +-- DiffViewSignColumn = { bg = 'none' }, +-- -- Treesitter +-- -- ['@string'] = { fg = colors.yellow, bg = '' }, +-- ['@boolean'] = { fg = colors.dark_yellow }, +-- ['@character'] = { fg = colors.foreground }, +-- ['@character.special'] = { fg = colors.dark_orange }, +-- ['@comment'] = { link = 'Comment' }, +-- ['@conditional'] = { fg = colors.blue }, +-- ['@constant'] = { fg = colors.foreground }, +-- ['@constant.builtin'] = { fg = colors.dark_yellow }, +-- ['@constant.macro'] = { fg = colors.dark_orange }, +-- ['@constructor'] = { fg = colors.blue }, +-- ['@debug'] = { link = 'Debug' }, +-- ['@define'] = { link = "Define" }, +-- ['@exception'] = { fg = colors.dark_orange }, +-- ['@field'] = { link = 'Identifier' }, +-- ['@field.yaml'] = { fg = colors.light_orange }, +-- ['@float'] = { fg = colors.light_pink }, +-- ['@function'] = { link = 'Function' }, +-- ['@function.builtin'] = { fg = colors.dark_green }, +-- ['@function.macro'] = { fg = colors.dark_orange }, +-- ['@include'] = { fg = colors.dark_orange }, +-- ['@keyword'] = { link = 'Keyword' }, +-- ['@keyword.operator'] = { fg = colors.purple }, +-- ['@keyword.return'] = { fg = colors.dark_orange }, +-- ['@label'] = { fg = colors.blue }, +-- ['@macro'] = { fg = colors.dark_orange }, +-- ['@method'] = { fg = colors.foreground }, +-- ['@namespace'] = { fg = colors.foreground }, +-- ['@number'] = { link = 'Number' }, +-- ['@operator'] = { link = 'Operator' }, +-- ['@parameter'] = { fg = colors.foreground }, +-- ['@preproc'] = { link = 'PreProc' }, +-- ['@property'] = { fg = colors.foreground }, +-- ['@punctuation.Special'] = { fg = colors.purple }, +-- ['@punctuation.bracket'] = { fg = colors.purple }, +-- ['@punctuation.delimiter'] = { fg = colors.purple }, +-- ['@repeat'] = { link = 'Repeat' }, +-- ['@storageclass'] = { link = 'StorageClass' }, +-- ['@string.escape'] = { fg = colors.dark_orange }, +-- ['@string.regex'] = { fg = colors.green }, +-- ['@string.special'] = { fg = colors.dark_orange }, +-- ['@structure'] = { link = 'Structure' }, +-- ['@tag'] = { link = 'Tag' }, +-- ['@tag.attribute'] = { fg = colors.foreground }, +-- ['@tag.delimiter'] = { fg = colors.purple }, +-- ['@text.danger'] = { fg = colors.dark_orange }, +-- ['@text.literal'] = { link = 'String' }, +-- ['@text.reference'] = { fg = colors.green }, +-- ['@text.strong'] = { bold = true }, +-- ['@text.title'] = { link = 'Title' }, +-- ['@text.todo'] = { link = 'Todo' }, +-- ['@text.underline'] = { link = 'Underlined' }, +-- ['@text.uri'] = { fg = colors.blue }, +-- ['@text.warning'] = { link = 'Todo' }, +-- ['@type'] = { link = 'Type' }, +-- ['@type.definition'] = { link = 'Typedef' }, +-- ['@variable'] = { fg = colors.foreground }, +-- ['@variable.builtin'] = { fg = colors.light_orange }, +--} +-- +--local M = {} +-- +--local function _load(config) +-- for group, hl in pairs(config) do +-- if not vim.tbl_isempty(hl) then +-- vim.api.nvim_set_hl(0, group, hl) +-- end +-- end +--end +-- +-- +--function M.setup() +-- vim.api.nvim_set_hl(0, 'XMenu', { bg = colors.dark_grey, default = true }) +-- vim.api.nvim_set_hl(0, 'XMenuBorder', { bg = colors.dark_grey, fg = colors.dark_grey, default = true }) +-- vim.g.terminal_color_0 = colors.dark_grey +--end +-- +----function M.load(full) +---- _load(base) +---- +---- if not full then +---- _load_diagnostics() +---- return +---- end +---- +---- _load(theme) +----end +-- +--return M -- cgit v1.2.3 From 1332fa9a98fd4ae92922e556d1753db5766bc74d Mon Sep 17 00:00:00 2001 From: srdusr Date: Sat, 20 May 2023 20:44:54 +0200 Subject: Add which-key config --- lua/plugins/which-key.lua | 60 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 lua/plugins/which-key.lua diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua new file mode 100644 index 0000000..10c0c41 --- /dev/null +++ b/lua/plugins/which-key.lua @@ -0,0 +1,60 @@ +require("which-key").setup { + plugins = { + marks = true, -- shows a list of your marks on ' and ` + registers = true, -- shows your registers on " in NORMAL or in INSERT mode + spelling = { + enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions + suggestions = 9, -- how many suggestions should be shown in the list? + }, + -- the presets plugin, adds help for a bunch of default keybindings in Neovim + -- No actual key bindings are created + presets = { + operators = true, -- adds help for operators like d, y, ... and registers them for motion / text object completion + motions = true, -- adds help for motions + text_objects = true, -- help for text objects triggered after entering an operator + windows = true, -- default bindings on + nav = true, -- misc bindings to work with windows + z = true, -- bindings for folds, spelling and others prefixed with z + g = true, -- bindings for prefixed with g + }, + }, + -- add operators that will trigger motion and text object completion + -- to enable all native operators, set the preset / operators plugin above + operators = { gc = "Comments" }, + key_labels = { + -- override the label used to display some keys. It doesn't effect WK in any other way. + -- For example: + -- [""] = "SPC", + -- [""] = "RET", + -- [""] = "TAB", + }, + icons = { + breadcrumb = "»", -- symbol used in the command line area that shows your active key combo + separator = "➜", -- symbol used between a key and it's label + group = "+", -- symbol prepended to a group + }, + window = { + border = "none", -- none, single, double, shadow + position = "bottom", -- bottom, top + margin = { 0, 0, 0, 0 }, -- extra window margin [top, right, bottom, left] + padding = { 1, 0, 1, 0 }, -- extra window padding [top, right, bottom, left] + }, + layout = { + height = { min = 1, max = 25 }, -- min and max height of the columns + width = { min = 20, max = 50 }, -- min and max width of the columns + spacing = 1, -- spacing between columns + align = "center", -- align columns left, center or right + }, + ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label + hidden = { "", "", "", "", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate + show_help = true, -- show help message on the command line when the popup is visible + triggers = "auto", -- automatically setup triggers + -- triggers = {""} -- or specify a list manually + + triggers_blacklist = { + -- list of mode / prefixes that should never be hooked by WhichKey + -- this is mostly relevant for key maps that start with a native binding + -- most people should not need to change this + n = { "o", "O" }, + }, +} -- cgit v1.2.3 From 691f41ae92bd6c8a2ff9fb12edbd99fd4e1e4fca Mon Sep 17 00:00:00 2001 From: srdusr Date: Sat, 20 May 2023 20:45:21 +0200 Subject: Add which-key config --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 76547ff..499db91 100644 --- a/init.lua +++ b/init.lua @@ -92,6 +92,7 @@ local modules = { "plugins.neotest", "plugins.heirline", "plugins.dashboard", + "plugins.which-key", --"plugins.modify-blend", } -- cgit v1.2.3 From e4f712a3cd7ee6f21015bb881a955ce55e45f873 Mon Sep 17 00:00:00 2001 From: srdusr Date: Sat, 20 May 2023 20:54:45 +0200 Subject: Add harpoon config --- lua/plugins/harpoon.lua | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 lua/plugins/harpoon.lua diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua new file mode 100644 index 0000000..1e9c030 --- /dev/null +++ b/lua/plugins/harpoon.lua @@ -0,0 +1,5 @@ +require("harpoon").setup({ + menu = { + width = vim.api.nvim_win_get_width(0) - 4, + } +}) -- cgit v1.2.3 From 405d673264b4d63d74513f22b41557143ccbddfa Mon Sep 17 00:00:00 2001 From: srdusr Date: Sat, 20 May 2023 20:55:11 +0200 Subject: Add harpoon config --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 499db91..21c2ba0 100644 --- a/init.lua +++ b/init.lua @@ -93,6 +93,7 @@ local modules = { "plugins.heirline", "plugins.dashboard", "plugins.which-key", + "plugins.harpoon", --"plugins.modify-blend", } -- cgit v1.2.3 From f0ad704dec96c888a258fb53a907512535d2bda8 Mon Sep 17 00:00:00 2001 From: srdusr Date: Sat, 20 May 2023 21:15:49 +0200 Subject: Add keybindings --- lua/plugins/harpoon.lua | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua index 1e9c030..eac4f35 100644 --- a/lua/plugins/harpoon.lua +++ b/lua/plugins/harpoon.lua @@ -1,5 +1,23 @@ require("harpoon").setup({ - menu = { - width = vim.api.nvim_win_get_width(0) - 4, - } + menu = { + width = vim.api.nvim_win_get_width(0) - 4, + }, + --keys = { + -- { "mt", function() require("harpoon.mark").toggle_file() end, desc = "Toggle File" }, + -- { "mm", function() require("harpoon.ui").toggle_quick_menu() end, desc = "Harpoon Menu" }, + -- { "mc", function() require("harpoon.cmd-ui").toggle_quick_menu() end, desc = "Command Menu" }, + -- --{ "1", function() require("harpoon.ui").nav_file(1) end, desc = "File 1" }, + -- --{ "2", function() require("harpoon.ui").nav_file(2) end, desc = "File 2" }, + -- --{ "3", function() require("harpoon.term").gotoTerminal(1) end, desc = "Terminal 1" }, + -- --{ "4", function() require("harpoon.term").gotoTerminal(2) end, desc = "Terminal 2" }, + -- --{ "5", function() require("harpoon.term").sendCommand(1,1) end, desc = "Command 1" }, + -- --{ "6", function() require("harpoon.term").sendCommand(1,2) end, desc = "Command 2" }, + --}, }) +vim.api.nvim_set_keymap("n", "ma", ":lua require('harpoon.mark').add_file()", {}) +vim.api.nvim_set_keymap("n", "mt", ":lua require('harpoon.mark').toggle_file()", {}) +vim.api.nvim_set_keymap("n", "mq", ":lua require('harpoon.ui').toggle_quick_menu()", {}) +vim.api.nvim_set_keymap("n", "mh", ":lua require('harpoon.ui').nav_file(1)", {}) +vim.api.nvim_set_keymap("n", "mj", ":lua require('harpoon.ui').nav_file(2)", {}) +vim.api.nvim_set_keymap("n", "mk", ":lua require('harpoon.ui').nav_file(3)", {}) +vim.api.nvim_set_keymap("n", "ml", ":lua require('harpoon.ui').nav_file(4)", {}) -- cgit v1.2.3 From 6654d77d54c4e6addff00d48e35dce4e9a071b59 Mon Sep 17 00:00:00 2001 From: srdusr Date: Wed, 24 May 2023 23:01:51 +0200 Subject: Disabled/commented out startup out of possibility it's resetting my CWD --- lua/plugins/telescope.lua | 64 +++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 6e8745c..4428a02 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -411,37 +411,37 @@ local with_title = function(opts, extra) }, extra or {}) end ---vim.api.nvim_create_augroup('startup', { clear = true }) ---vim.api.nvim_command('augroup startup') ---vim.api.nvim_command('autocmd!') ---vim.api.nvim_command('autocmd VimEnter * lua require("plugins/telescope").startup()') ---vim.api.nvim_command('augroup END') - - -local startup = function() - -- Open file browser if argument is a folder - local arg = vim.api.nvim_eval('argv(0)') - if arg and (vim.fn.isdirectory(arg) ~= 0 or arg == "") then - vim.defer_fn(function() - require('telescope.builtin').find_files(with_title(dropdown)) --- require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ --- hidden = true, --- results_title = '', --- layout_config = { prompt_position = 'top' }, --- })) - end, 10) - end -end - - - --- Define the custom command startup/findhere -vim.cmd('command! Startup lua require("plugins.telescope").startup()') -vim.cmd('command! Findhere lua require("plugins.telescope").startup()') - ---vim.api.nvim_command('autocmd VimEnter * lua require("plugins/telescope").startup()') - --- Merge the existing M table with the startup function table -M = vim.tbl_extend('force', M, { startup = startup }) +----vim.api.nvim_create_augroup('startup', { clear = true }) +----vim.api.nvim_command('augroup startup') +----vim.api.nvim_command('autocmd!') +----vim.api.nvim_command('autocmd VimEnter * lua require("plugins/telescope").startup()') +----vim.api.nvim_command('augroup END') +-- +-- +--local startup = function() +-- -- Open file browser if argument is a folder +-- local arg = vim.api.nvim_eval('argv(0)') +-- if arg and (vim.fn.isdirectory(arg) ~= 0 or arg == "") then +-- vim.defer_fn(function() +-- require('telescope.builtin').find_files(with_title(dropdown)) +---- require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ +---- hidden = true, +---- results_title = '', +---- layout_config = { prompt_position = 'top' }, +---- })) +-- end, 10) +-- end +--end +-- +-- +-- +---- Define the custom command startup/findhere +--vim.cmd('command! Startup lua require("plugins.telescope").startup()') +--vim.cmd('command! Findhere lua require("plugins.telescope").startup()') +-- +----vim.api.nvim_command('autocmd VimEnter * lua require("plugins/telescope").startup()') +-- +---- Merge the existing M table with the startup function table +--M = vim.tbl_extend('force', M, { startup = startup }) return M -- cgit v1.2.3 From 6d5680f750d4a7e6760bd55ae0b4543f6ed0b609 Mon Sep 17 00:00:00 2001 From: srdusr Date: Wed, 24 May 2023 23:28:16 +0200 Subject: Add jump list mapping --- lua/user/keys.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/user/keys.lua b/lua/user/keys.lua index b969839..8f01bc1 100644 --- a/lua/user/keys.lua +++ b/lua/user/keys.lua @@ -157,8 +157,12 @@ map("v", "sr", 'y:%s/"//gc') -- Toggle Diff map("n", "td", "call utils#ToggleDiff()") +-- Toggle Verbose map("n", "tv", "call utils#ToggleVerbose()") +-- Jump List +map("n", "j", "call utils#GotoJump()") + -- Map delete to Ctrl+l map("i", "", "") -- cgit v1.2.3 From 0362d66448d336f56340f4526548d2e80d2f2cc6 Mon Sep 17 00:00:00 2001 From: srdusr Date: Wed, 24 May 2023 23:28:50 +0200 Subject: Add EndOfBuffer binding --- lua/plugins/colorscheme.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index 4be9a7e..6f9e9d2 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -49,7 +49,7 @@ 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 EndOfBuffer guibg=NONE guifg=Normal") -- Set different window separator colorscheme vim.cmd [[ au WinEnter * setl winhl=WinSeparator:WinSeparatorA -- cgit v1.2.3 From 50189c2b54ad4a2b16ef1192799913dfe0e57667 Mon Sep 17 00:00:00 2001 From: srdusr Date: Wed, 24 May 2023 23:29:26 +0200 Subject: Add GotoJump script --- autoload/utils.vim | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/autoload/utils.vim b/autoload/utils.vim index 03fdb07..f1270bf 100644 --- a/autoload/utils.vim +++ b/autoload/utils.vim @@ -129,4 +129,22 @@ function! utils#ToggleVerbose() endfunction +"------------------------------------------------- + +" Jump List +function! utils#GotoJump() + jumps + let j = input("Please select your jump: ") + if j != '' + let pattern = '\v\c^\+' + if j =~ pattern + let j = substitute(j, pattern, '', 'g') + execute "normal " . j . "\" + else + execute "normal " . j . "\" + endif + endif +endfunction + + "------------------------------------------------- -- cgit v1.2.3 From de96240fdb23cfde1ef38e8f09e4045d386c132d Mon Sep 17 00:00:00 2001 From: srdusr Date: Wed, 24 May 2023 23:30:11 +0200 Subject: Changed "jj" to exit insert-mode to "jk" --- lua/user/keys.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/user/keys.lua b/lua/user/keys.lua index 8f01bc1..12789a5 100644 --- a/lua/user/keys.lua +++ b/lua/user/keys.lua @@ -20,7 +20,7 @@ vim.g.mapleader = ";" --map("n", "", ".") -- "jj" to exit insert-mode -map("i", "jj", "") +map("i", "jk", "") -- Reload nvim config map("n", "", -- cgit v1.2.3 From 4c049b3a71be4ee10b506f57bc558ea984d510d6 Mon Sep 17 00:00:00 2001 From: srdusr Date: Wed, 24 May 2023 23:31:09 +0200 Subject: Changed "jj" to exit insert-mode to "jk" --- lua/plugins/toggleterm.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua index f787f46..bc2df4b 100644 --- a/lua/plugins/toggleterm.lua +++ b/lua/plugins/toggleterm.lua @@ -58,8 +58,8 @@ toggleterm.setup({ local mods = require("user.mods") local float_handler = function(term) - if not mods.empty(vim.fn.mapcheck('jj', 't')) then - vim.keymap.del('t', 'jj', { buffer = term.bufnr }) + if not mods.empty(vim.fn.mapcheck('jk', 't')) then + vim.keymap.del('t', 'jk', { buffer = term.bufnr }) vim.keymap.del('t', '', { buffer = term.bufnr }) end end @@ -68,7 +68,7 @@ function _G.set_terminal_keymaps() local opts = { noremap = true } --local opts = {buffer = 0} vim.api.nvim_buf_set_keymap(0, "t", "", [[]], opts) - vim.api.nvim_buf_set_keymap(0, "t", "jj", [[]], opts) + vim.api.nvim_buf_set_keymap(0, "t", "jk", [[]], opts) vim.api.nvim_buf_set_keymap(0, "t", "", [[h]], opts) vim.api.nvim_buf_set_keymap(0, "t", "", [[j]], opts) vim.api.nvim_buf_set_keymap(0, "t", "", [[k]], opts) -- cgit v1.2.3