diff options
| author | srdusr <trevorgray@srdusr.com> | 2023-05-24 23:36:55 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2023-05-24 23:36:55 +0200 |
| commit | 32f6c95872f3307d09cbe299ce1b73e66905fa1d (patch) | |
| tree | 1cff401b07663cc5f9809f56fb5c85a71d3e7869 | |
| parent | dc725d6148b874b621d9d6ca9eaeab730925e173 (diff) | |
| parent | 4c049b3a71be4ee10b506f57bc558ea984d510d6 (diff) | |
| download | dotfiles-32f6c95872f3307d09cbe299ce1b73e66905fa1d.tar.gz dotfiles-32f6c95872f3307d09cbe299ce1b73e66905fa1d.zip | |
Merge commit '85542df5744896838cd2f3407ca74fac5557fc8d'
| -rw-r--r-- | .config/nvim/autoload/utils.vim | 18 | ||||
| -rw-r--r-- | .config/nvim/init.lua | 5 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/colorizer.lua | 6 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/colorscheme.lua | 313 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/harpoon.lua | 23 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/telescope.lua | 139 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/toggleterm.lua | 6 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/which-key.lua | 60 | ||||
| -rw-r--r-- | .config/nvim/lua/user/keys.lua | 6 | ||||
| -rw-r--r-- | .config/nvim/lua/user/pack.lua | 42 |
10 files changed, 567 insertions, 51 deletions
diff --git a/.config/nvim/autoload/utils.vim b/.config/nvim/autoload/utils.vim index 03fdb07..f1270bf 100644 --- a/.config/nvim/autoload/utils.vim +++ b/.config/nvim/autoload/utils.vim @@ -130,3 +130,21 @@ 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 . "\<c-i>" + else + execute "normal " . j . "\<c-o>" + endif + endif +endfunction + + +"------------------------------------------------- diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 8c146b0..21c2ba0 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/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,9 @@ local modules = { "plugins.neotest", "plugins.heirline", "plugins.dashboard", + "plugins.which-key", + "plugins.harpoon", + --"plugins.modify-blend", } diff --git a/.config/nvim/lua/plugins/colorizer.lua b/.config/nvim/lua/plugins/colorizer.lua deleted file mode 100644 index 14d25e2..0000000 --- a/.config/nvim/lua/plugins/colorizer.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status, colorizer = pcall(require, "colorizer") -if (not status) then return end - -colorizer.setup({ - '*'; -}) diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua index 2735204..6f9e9d2 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 nvimgelion ]] +-- [[ nightfly ayu onedark doom-one nvimgelion github_dark ]] local colorscheme = "doom-one" local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) if not status_ok then @@ -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") @@ -32,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 @@ -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 diff --git a/.config/nvim/lua/plugins/harpoon.lua b/.config/nvim/lua/plugins/harpoon.lua new file mode 100644 index 0000000..eac4f35 --- /dev/null +++ b/.config/nvim/lua/plugins/harpoon.lua @@ -0,0 +1,23 @@ +require("harpoon").setup({ + 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" }, + -- --{ "<leader>1", function() require("harpoon.ui").nav_file(1) end, desc = "File 1" }, + -- --{ "<leader>2", function() require("harpoon.ui").nav_file(2) end, desc = "File 2" }, + -- --{ "<leader>3", function() require("harpoon.term").gotoTerminal(1) end, desc = "Terminal 1" }, + -- --{ "<leader>4", function() require("harpoon.term").gotoTerminal(2) end, desc = "Terminal 2" }, + -- --{ "<leader>5", function() require("harpoon.term").sendCommand(1,1) end, desc = "Command 1" }, + -- --{ "<leader>6", function() require("harpoon.term").sendCommand(1,2) end, desc = "Command 2" }, + --}, +}) +vim.api.nvim_set_keymap("n", "<leader>ma", ":lua require('harpoon.mark').add_file()<CR>", {}) +vim.api.nvim_set_keymap("n", "<leader>mt", ":lua require('harpoon.mark').toggle_file()<CR>", {}) +vim.api.nvim_set_keymap("n", "<leader>mq", ":lua require('harpoon.ui').toggle_quick_menu()<CR>", {}) +vim.api.nvim_set_keymap("n", "<leader>mh", ":lua require('harpoon.ui').nav_file(1)<CR>", {}) +vim.api.nvim_set_keymap("n", "<leader>mj", ":lua require('harpoon.ui').nav_file(2)<CR>", {}) +vim.api.nvim_set_keymap("n", "<leader>mk", ":lua require('harpoon.ui').nav_file(3)<CR>", {}) +vim.api.nvim_set_keymap("n", "<leader>ml", ":lua require('harpoon.ui').nav_file(4)<CR>", {}) diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 9c72dcf..4428a02 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/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 diff --git a/.config/nvim/lua/plugins/toggleterm.lua b/.config/nvim/lua/plugins/toggleterm.lua index f787f46..bc2df4b 100644 --- a/.config/nvim/lua/plugins/toggleterm.lua +++ b/.config/nvim/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', '<esc>', { 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", "<esc>", [[<C-\><C-n>]], opts) - vim.api.nvim_buf_set_keymap(0, "t", "jj", [[<C-\><C-n>]], opts) + vim.api.nvim_buf_set_keymap(0, "t", "jk", [[<C-\><C-n>]], opts) vim.api.nvim_buf_set_keymap(0, "t", "<C-h>", [[<C-\><C-n><C-W>h]], opts) vim.api.nvim_buf_set_keymap(0, "t", "<C-j>", [[<C-\><C-n><C-W>j]], opts) vim.api.nvim_buf_set_keymap(0, "t", "<C-k>", [[<C-\><C-n><C-W>k]], opts) diff --git a/.config/nvim/lua/plugins/which-key.lua b/.config/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..10c0c41 --- /dev/null +++ b/.config/nvim/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 <C-r> 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 <c-w> + 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: + -- ["<space>"] = "SPC", + -- ["<cr>"] = "RET", + -- ["<tab>"] = "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 = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "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 = {"<leader>"} -- 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" }, + }, +} diff --git a/.config/nvim/lua/user/keys.lua b/.config/nvim/lua/user/keys.lua index b969839..12789a5 100644 --- a/.config/nvim/lua/user/keys.lua +++ b/.config/nvim/lua/user/keys.lua @@ -20,7 +20,7 @@ vim.g.mapleader = ";" --map("n", "<Space>", ".") -- "jj" to exit insert-mode -map("i", "jj", "<esc>") +map("i", "jk", "<esc>") -- Reload nvim config map("n", "<leader><CR>", @@ -157,8 +157,12 @@ map("v", "<leader>sr", 'y:%s/<C-r><C-r>"//g<Left><Left>c') -- Toggle Diff map("n", "<leader>td", "<Cmd>call utils#ToggleDiff()<CR>") +-- Toggle Verbose map("n", "<leader>tv", "<Cmd>call utils#ToggleVerbose()<CR>") +-- Jump List +map("n", "<leader>j", "<Cmd>call utils#GotoJump()<CR>") + -- Map delete to Ctrl+l map("i", "<C-l>", "<Del>") diff --git a/.config/nvim/lua/user/pack.lua b/.config/nvim/lua/user/pack.lua index c45517d..256503e 100644 --- a/.config/nvim/lua/user/pack.lua +++ b/.config/nvim/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 @@ -217,6 +231,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") -- @@ -237,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() @@ -261,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 |
