mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 20:25:30 +00:00
chore(nvim): move plugins into after plugin folder
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
-- alpha-nvim – https://github.com/goolord/alpha-nvim
|
||||
local status_ok, alpha = pcall(require, "alpha")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
dashboard.section.header.val = {
|
||||
[[🟨🟨🟨🟨🟨🟨🟨🟨]],
|
||||
[[🟨🟨🟨🟨🟨🟨🟨🟨]],
|
||||
[[🟨🟨🟨 🐍 🟨🟨🟨]],
|
||||
[[🟨🟨🌿🌿🌿🌿🟨🟨]],
|
||||
[[🟨🟨🟨🟨🟨🟨🟨🟨]],
|
||||
[[DONT TREAD ON ME]],
|
||||
}
|
||||
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("f", " Find Files", ":FzfLua files<CR>"),
|
||||
dashboard.button("e", " New File", ":ene <BAR> startinsert<CR>"),
|
||||
dashboard.button("p", " Find Project", ":Telescope projects<CR>"),
|
||||
dashboard.button("r", " Recently Used Files", ":FzfLua oldfiles<CR>"),
|
||||
dashboard.button("t", " Find Text", ":FzfLua live_grep<CR>"),
|
||||
dashboard.button("b", " Browser Bookmarks", ":Telescope bookmarks<CR>"),
|
||||
dashboard.button("c", " Configuration", ":e ~/.config/nvim/init.lua<CR>"),
|
||||
dashboard.button("u", " Update Plugins", ":PackerUpdate<CR>"),
|
||||
dashboard.button("q", " Quit Neovim", ":qa<CR>"),
|
||||
}
|
||||
|
||||
dashboard.section.footer.opts.hl = "Type"
|
||||
dashboard.section.header.opts.hl = "Include"
|
||||
dashboard.section.buttons.opts.hl = "Keyword"
|
||||
|
||||
dashboard.opts.opts.noautocmd = true
|
||||
|
||||
alpha.setup(dashboard.opts)
|
||||
@@ -1,34 +0,0 @@
|
||||
-- nvim-autopairs – https://github.com/windwp/nvim-autopairs
|
||||
local status_ok, autopairs = pcall(require, "nvim-autopairs")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
autopairs.setup {
|
||||
check_ts = true,
|
||||
ts_config = {
|
||||
lua = { "string", "source" },
|
||||
javascript = { "string", "template_string" },
|
||||
java = false,
|
||||
},
|
||||
disable_filetype = { "TelescopePrompt", "spectre_panel" },
|
||||
fast_wrap = {
|
||||
map = "<C-l>",
|
||||
chars = { "{", "[", "(", '"', "'" },
|
||||
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
|
||||
offset = 0, -- Offset from pattern match
|
||||
end_key = "$",
|
||||
keys = "qwertzuiopyxcvbnmasdfghjkl",
|
||||
check_comma = true,
|
||||
highlight = "PmenuSel",
|
||||
highlight_grey = "LineNr",
|
||||
},
|
||||
}
|
||||
|
||||
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
|
||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
if not cmp_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } })
|
||||
@@ -1,7 +0,0 @@
|
||||
-- nvim-ts-autotag – https://github.com/windwp/nvim-ts-autotag
|
||||
local status_ok, autotag = pcall(require, "nvim-ts-autotag")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
autotag.setup()
|
||||
@@ -1,10 +0,0 @@
|
||||
-- blamer.vim – https://github.com/APZelos/blamer.nvim
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
vim.g.blamer_enabled = 0
|
||||
vim.g.blamer_relative_time = 1
|
||||
vim.g.blamer_delay = 200
|
||||
|
||||
-- Keymaps
|
||||
keymap("n", "<leader>tb", [[<Cmd>BlamerToggle<CR>]], opts)
|
||||
@@ -1,71 +0,0 @@
|
||||
-- bufferline.nvim – https://github.com/akinsho/bufferline.nvim
|
||||
local status_ok, bufferline = pcall(require, "bufferline")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
bufferline.setup({
|
||||
highlights = {
|
||||
fill = {
|
||||
guibg = "#282828",
|
||||
},
|
||||
tab_selected = {
|
||||
guifg = {
|
||||
attribute = "fg",
|
||||
highlight = "Normal",
|
||||
},
|
||||
guibg = {
|
||||
attribute = "bg",
|
||||
highlight = "Normal",
|
||||
},
|
||||
},
|
||||
tab = {
|
||||
guifg = {
|
||||
attribute = "fg",
|
||||
highlight = "TabLine",
|
||||
},
|
||||
guibg = {
|
||||
attribute = "bg",
|
||||
highlight = "TabLine",
|
||||
},
|
||||
},
|
||||
indicator_selected = {
|
||||
guifg = {
|
||||
attribute = "fg",
|
||||
highlight = "LspDiagnosticsDefaultHint",
|
||||
},
|
||||
guibg = {
|
||||
attribute = "bg",
|
||||
highlight = "Normal",
|
||||
},
|
||||
},
|
||||
},
|
||||
options = {
|
||||
modified_icon = "●",
|
||||
left_trunc_marker = "",
|
||||
right_trunc_marker = "",
|
||||
close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions"
|
||||
max_name_length = 25,
|
||||
max_prefix_length = 25,
|
||||
enforce_regular_tabs = false,
|
||||
view = "multiwindow",
|
||||
show_buffer_close_icons = true,
|
||||
show_close_icon = false,
|
||||
separator_style = "thin",
|
||||
diagnostics = "nvim_lsp",
|
||||
diagnostics_update_in_insert = false,
|
||||
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||
return "(" .. count .. ")"
|
||||
end,
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
text = "File Explorer",
|
||||
highlight = "Directory",
|
||||
text_align = "left",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -1,139 +0,0 @@
|
||||
-- nvim-cmp – https://github.com/hrsh7th/nvim-cmp
|
||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
if not cmp_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local snip_status_ok, luasnip = pcall(require, "luasnip")
|
||||
if not snip_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
|
||||
local check_backspace = function()
|
||||
local col = vim.fn.col(".") - 1
|
||||
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
|
||||
end
|
||||
|
||||
-- פּ ﯟ some other good icons
|
||||
local kind_icons = {
|
||||
Text = "",
|
||||
Method = "m",
|
||||
Function = "",
|
||||
Constructor = "",
|
||||
Field = "",
|
||||
Variable = "",
|
||||
Class = "",
|
||||
Interface = "",
|
||||
Module = "",
|
||||
Property = "",
|
||||
Unit = "",
|
||||
Value = "",
|
||||
Enum = "",
|
||||
Keyword = "",
|
||||
Snippet = "",
|
||||
Color = "",
|
||||
File = "",
|
||||
Reference = "",
|
||||
Folder = "",
|
||||
EnumMember = "",
|
||||
Constant = "",
|
||||
Struct = "",
|
||||
Event = "",
|
||||
Operator = "",
|
||||
TypeParameter = "",
|
||||
}
|
||||
-- find more here: https://www.nerdfonts.com/cheat-sheet
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body) -- For `luasnip` users.
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
||||
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
|
||||
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
|
||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||
["<C-x>"] = cmp.mapping.complete(),
|
||||
["<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>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expandable() then
|
||||
luasnip.expand()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif check_backspace() then
|
||||
fallback()
|
||||
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" }),
|
||||
},
|
||||
formatting = {
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
format = function(entry, vim_item)
|
||||
-- Kind icons
|
||||
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
|
||||
-- vim_item.kind = string.format("%s %s", kind_icons[vim_item.kind], vim_item.kind) -- This concatenates the icons with the name of the item kind
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "[LSP]",
|
||||
luasnip = "[Snippet]",
|
||||
buffer = "[Buffer]",
|
||||
path = "[Path]",
|
||||
spell = "[Spell]",
|
||||
dictionary = "[Dictionary]",
|
||||
omni = "[Omni]",
|
||||
nvim_lua = "[Nvim Lua]",
|
||||
npm = "[npm]",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "nvim_lsp_signature_help" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
{ name = "dictionary" },
|
||||
{ name = "omni" },
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "spell" },
|
||||
{ name = "npm", keyword_length = 4 },
|
||||
},
|
||||
confirm_opts = {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = false,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = true,
|
||||
native_menu = false,
|
||||
},
|
||||
})
|
||||
@@ -1,24 +0,0 @@
|
||||
-- colorizer.lua – https://github.com/norcalli/nvim-colorizer.lua
|
||||
local status, colorizer = pcall(require, "colorizer")
|
||||
if not status then
|
||||
return
|
||||
end
|
||||
|
||||
colorizer.setup({
|
||||
"css",
|
||||
"html",
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
}, {
|
||||
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
|
||||
mode = "background", -- Set the display mode.)
|
||||
})
|
||||
@@ -1,23 +0,0 @@
|
||||
-- Comment.nvim – https://github.com/numToStr/comment.nvim
|
||||
local status_ok, comment = pcall(require, "Comment")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
comment.setup {
|
||||
pre_hook = function(ctx)
|
||||
local U = require "Comment.utils"
|
||||
|
||||
local location = nil
|
||||
if ctx.ctype == U.ctype.block then
|
||||
location = require("ts_context_commentstring.utils").get_cursor_location()
|
||||
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
|
||||
location = require("ts_context_commentstring.utils").get_visual_start_location()
|
||||
end
|
||||
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring {
|
||||
key = ctx.ctype == U.ctype.line and "__default" or "__multiline",
|
||||
location = location,
|
||||
}
|
||||
end
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
-- nvim-cursorline – https://github.com/yamatsum/nvim-cursorline
|
||||
local status, cursorline = pcall(require, "nvim-cursorline")
|
||||
if not status then
|
||||
return
|
||||
end
|
||||
|
||||
cursorline.setup({
|
||||
cursorline = {
|
||||
enable = true,
|
||||
timeout = 1000,
|
||||
number = false,
|
||||
},
|
||||
cursorword = {
|
||||
enable = true,
|
||||
min_length = 3,
|
||||
hl = { underline = true },
|
||||
},
|
||||
})
|
||||
@@ -1,6 +0,0 @@
|
||||
--- export-to-vscode.nvim – https://github.com/elijahmanor/export-to-vscode.nvim
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
-- Keymaps
|
||||
keymap("n", "<leader>code", [[<Cmd>lua require("export-to-vscode").launch()<CR>]], opts)
|
||||
@@ -1,44 +0,0 @@
|
||||
-- fzf-lua – https://github.com/ibhagwan/fzf-lua
|
||||
local cmp_status_ok, fzf_lua = pcall(require, "fzf-lua")
|
||||
if not cmp_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
fzf_lua.setup({
|
||||
lsp = {
|
||||
async_or_timeout = 3000, -- make lsp requests synchronous so they work with null-ls
|
||||
},
|
||||
})
|
||||
|
||||
-- Keymaps
|
||||
keymap("n", "<C-p>", [[<Cmd>:FzfLua files<CR>]], opts)
|
||||
keymap("n", "<leader>b", [[<Cmd>:FzfLua buffers<CR>]], opts)
|
||||
keymap("n", "<leader>zbl", [[<Cmd>:FzfLua blines<CR>]], opts)
|
||||
keymap("n", "<leader>zf", [[<Cmd>:FzfLua files<CR>]], opts)
|
||||
keymap("n", "<leader>zg", [[<Cmd>:FzfLua grep<CR>]], opts)
|
||||
keymap("n", "<leader>zgb", [[<Cmd>:FzfLua git_branches<CR>]], opts)
|
||||
keymap("n", "<leader>zgc", [[<Cmd>:FzfLua git_commits<CR>]], opts)
|
||||
keymap("n", "<leader>zgl", [[<Cmd>:FzfLua grep_last<CR>]], opts)
|
||||
keymap("n", "<leader>zgp", [[<Cmd>:FzfLua grep_project<CR>]], opts)
|
||||
keymap("n", "<leader>zgs", [[<Cmd>:FzfLua git_status<CR>]], opts)
|
||||
keymap("n", "<leader>zgst", [[<Cmd>:FzfLua git_stash<CR>]], opts)
|
||||
keymap("n", "<leader>zgv", [[<Cmd>:FzfLua grep_visual<CR>]], opts)
|
||||
keymap("n", "<leader>zgw", [[<Cmd>:FzfLua grep_cword<CR>]], opts)
|
||||
keymap("n", "<leader>zh", [[<Cmd>:FzfLua oldfiles<CR>]], opts)
|
||||
keymap("n", "<leader>zl", [[<Cmd>:FzfLua lines<CR>]], opts)
|
||||
keymap("n", "<leader>zlca", [[<Cmd>:FzfLua code_actions<CR>]], opts)
|
||||
keymap("n", "<leader>zld", [[<Cmd>:FzfLua lsp_definitions<CR>]], opts)
|
||||
keymap("n", "<leader>zlds", [[<Cmd>:FzfLua lsp_document_symbols<CR>]], opts)
|
||||
keymap("n", "<leader>zlg", [[<Cmd>:FzfLua live_grep<CR>]], opts)
|
||||
keymap("n", "<leader>zlgr", [[<Cmd>:FzfLua live_grep_resume<CR>]], opts)
|
||||
keymap("n", "<leader>zlr", [[<Cmd>:FzfLua lsp_references<CR>]], opts)
|
||||
keymap("n", "<leader>zltd", [[<Cmd>:FzfLua lsp_typedef<CR>]], opts)
|
||||
keymap("n", "<leader>zlws", [[<Cmd>:FzfLua lsp_live_workspace_symbols<CR>]], opts)
|
||||
keymap("n", "<leader>zm", [[<Cmd>:FzfLua marks<CR>]], opts)
|
||||
keymap("n", "<leader>zqfq", [[<Cmd>:FzfLua quickfix<CR>]], opts)
|
||||
keymap("n", "<leader>zr", [[<Cmd>:FzfLua resume<CR>]], opts)
|
||||
keymap("n", "<leader>zss", [[<Cmd>:FzfLua spell_suggest<CR>]], opts)
|
||||
keymap("n", "<leader>ztg", [[<Cmd>:FzfLua tabs<CR>]], opts)
|
||||
@@ -1,49 +0,0 @@
|
||||
-- gitsigns.nvim – https://github.com/lewis6991/gitsigns.nvim
|
||||
local status_ok, gitsigns = pcall(require, "gitsigns")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
gitsigns.setup({
|
||||
signs = {
|
||||
add = { hl = "GitSignsAdd", text = "▎", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
|
||||
change = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||
delete = { hl = "GitSignsDelete", text = "▎", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||
topdelete = { hl = "GitSignsDelete", text = "▎", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||
changedelete = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||
},
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
watch_gitdir = {
|
||||
interval = 1000,
|
||||
follow_files = true,
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol", -- "eol" | "overlay" | "right_align"
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
current_line_blame_formatter_opts = {
|
||||
relative_time = false,
|
||||
},
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000,
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
border = "single",
|
||||
style = "minimal",
|
||||
relative = "cursor",
|
||||
row = 0,
|
||||
col = 1,
|
||||
},
|
||||
yadm = {
|
||||
enable = false,
|
||||
},
|
||||
})
|
||||
@@ -1,30 +0,0 @@
|
||||
-- Goyo – https://github.com/junegunn/goyo.vim
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
vim.cmd([[
|
||||
function! s:goyo_enter()
|
||||
if executable('tmux') && strlen($TMUX)
|
||||
silent !tmux set status off
|
||||
silent !tmux list-panes -F '\#F' | grep -q Z || tmux resize-pane -Z
|
||||
endif
|
||||
set noshowmode
|
||||
set noshowcmd
|
||||
set scrolloff=999
|
||||
Gitsigns toggle_signs
|
||||
endfunction
|
||||
|
||||
function! s:goyo_leave()
|
||||
if executable('tmux') && strlen($TMUX)
|
||||
silent !tmux set status on
|
||||
silent !tmux list-panes -F '\#F' | grep -q Z && tmux resize-pane -Z
|
||||
endif
|
||||
set showmode
|
||||
set showcmd
|
||||
set scrolloff=8
|
||||
Gitsigns toggle_signs
|
||||
endfunction
|
||||
|
||||
autocmd! User GoyoEnter nested call <SID>goyo_enter()
|
||||
autocmd! User GoyoLeave nested call <SID>goyo_leave()
|
||||
]])
|
||||
@@ -1,18 +0,0 @@
|
||||
-- Harpoon – https://github.com/ThePrimeagen/harpoon
|
||||
local status, harpoon = pcall(require, "harpoon")
|
||||
if not status then
|
||||
return
|
||||
end
|
||||
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
harpoon.setup()
|
||||
|
||||
-- Keymaps
|
||||
keymap("n", "<leader>a", [[<Cmd>lua require("harpoon.mark").add_file()<CR>]], opts)
|
||||
keymap("n", "<leader>,", [[<Cmd>lua require("harpoon.ui").toggle_quick_menu()<CR>]], opts)
|
||||
keymap("n", "<leader>1", [[<Cmd>lua require("harpoon.ui").nav_file(1)<CR>]], opts)
|
||||
keymap("n", "<leader>2", [[<Cmd>lua require("harpoon.ui").nav_file(2)<CR>]], opts)
|
||||
keymap("n", "<leader>3", [[<Cmd>lua require("harpoon.ui").nav_file(3)<CR>]], opts)
|
||||
keymap("n", "<leader>4", [[<Cmd>lua require("harpoon.ui").nav_file(4)<CR>]], opts)
|
||||
@@ -1,7 +0,0 @@
|
||||
-- impatient.nvim – https://github.com/lewis6991/impatient.nvim
|
||||
local status_ok, impatient = pcall(require, "impatient")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
impatient.enable_profile()
|
||||
@@ -1,24 +0,0 @@
|
||||
-- Indent Blankline – https://github.com/lukas-reineke/indent-blankline.nvim
|
||||
local status_ok, indent_blankline = pcall(require, "indent_blankline")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
vim.opt.termguicolors = true
|
||||
vim.cmd([[
|
||||
highlight IndentBlanklineIndent1 guibg=#1f1f1f gui=nocombine
|
||||
highlight IndentBlanklineIndent2 guibg=#1a1a1a gui=nocombine
|
||||
]])
|
||||
|
||||
indent_blankline.setup({
|
||||
char = "",
|
||||
char_highlight_list = {
|
||||
"IndentBlanklineIndent1",
|
||||
"IndentBlanklineIndent2",
|
||||
},
|
||||
space_char_highlight_list = {
|
||||
"IndentBlanklineIndent1",
|
||||
"IndentBlanklineIndent2",
|
||||
},
|
||||
show_trailing_blankline_indent = false,
|
||||
})
|
||||
@@ -78,10 +78,10 @@ end
|
||||
local lsp_formatting = function(bufnr)
|
||||
-- vim.lsp.buf.format({})
|
||||
vim.lsp.buf.formatting_sync({
|
||||
bufnr = bufnr,
|
||||
filter = function(client)
|
||||
return client.name == "null-ls"
|
||||
end,
|
||||
bufnr = bufnr,
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
-- lualine.nvim – https://github.com/nvim-lualine/lualine.nvim
|
||||
local status, lualine = pcall(require, "lualine")
|
||||
if not status then
|
||||
return
|
||||
end
|
||||
|
||||
lualine.setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "onedark",
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = { "alpha", "dashboard", "NvimTree", "Outline " },
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch", "diff", "diagnostics" },
|
||||
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 = {},
|
||||
})
|
||||
@@ -1,7 +0,0 @@
|
||||
-- Neoscroll – https://github.com/karb94/neoscroll.nvim
|
||||
local status, neoscroll = pcall(require, 'neoscroll')
|
||||
if (not status) then
|
||||
return
|
||||
end
|
||||
|
||||
neoscroll.setup()
|
||||
@@ -1,9 +0,0 @@
|
||||
-- nvim-tree.lua – https://github.com/kyazdani42/nvim-tree.lua
|
||||
local status_ok, nvim_tree = pcall(require, "nvim-tree")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
nvim_tree.setup({
|
||||
sync_root_with_cwd = true,
|
||||
})
|
||||
@@ -1,33 +0,0 @@
|
||||
-- project.nvim – https://github.com/ahmedkhalf/project.nvim
|
||||
local status_ok, project = pcall(require, "project_nvim")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
project.setup({
|
||||
active = true,
|
||||
on_config_done = nil,
|
||||
manual_mode = false,
|
||||
detection_methods = {
|
||||
"pattern",
|
||||
},
|
||||
patterns = {
|
||||
".git",
|
||||
"_darcs",
|
||||
".hg",
|
||||
".bzr",
|
||||
".svn",
|
||||
"Makefile",
|
||||
".gitignore",
|
||||
"package.json",
|
||||
},
|
||||
show_hidden = false,
|
||||
silent_chdir = true,
|
||||
ignore_lsp = {},
|
||||
datapath = vim.fn.stdpath("data"),
|
||||
})
|
||||
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
keymap("n", "<leader>pm", [[<Cmd>:Telescope projects<CR>]], opts)
|
||||
@@ -1,7 +0,0 @@
|
||||
-- nvim-spectre – https://github.com/nvim-pack/nvim-spectre
|
||||
local status_ok, spectre = pcall(require, "spectre")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
spectre.setup()
|
||||
@@ -1,4 +0,0 @@
|
||||
-- speeddating.vim – https://github.com/tpope/vim-speeddating
|
||||
vim.cmd([[
|
||||
autocmd VimEnter * SpeedDatingFormat %d.%m.%Y
|
||||
]])
|
||||
@@ -1,170 +0,0 @@
|
||||
-- telescope.nvim – https://github.com/nvim-telescope/telescope.nvim/
|
||||
local status_ok, telescope = pcall(require, "telescope")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
-- Extensions
|
||||
telescope.load_extension("bookmarks")
|
||||
telescope.load_extension("node_modules")
|
||||
telescope.load_extension("file_browser")
|
||||
telescope.load_extension("frecency")
|
||||
telescope.load_extension("lsp_handlers")
|
||||
telescope.load_extension("fzf")
|
||||
telescope.load_extension("harpoon")
|
||||
telescope.load_extension("projects")
|
||||
|
||||
-- Keymaps
|
||||
keymap("n", "<leader>bm", [[<Cmd>Telescope bookmarks<CR>]], opts)
|
||||
keymap("n", "<leader>gb", [[<Cmd>Telescope git_branches<CR>]], opts)
|
||||
keymap("n", "<leader>gs", [[<Cmd>Telescope git_status<CR>]], opts)
|
||||
keymap("n", "<leader>ht", [[<Cmd>Telescope help_tags<CR>]], opts)
|
||||
keymap("n", "<leader>km", [[<Cmd>Telescope keymaps<CR>]], opts)
|
||||
keymap("n", "<leader>m", [[<Cmd>Telescope marks<CR>]], opts)
|
||||
keymap("n", "<leader>mru", [[<Cmd>Telescope frecency<CR>]], opts)
|
||||
keymap("n", "<leader>nm", [[<Cmd>Telescope node_modules list<CR>]], opts)
|
||||
keymap("n", "<leader>tb", [[<Cmd>Telescope buffers<CR>]], opts)
|
||||
keymap("n", "<leader>C", [[<Cmd>:Cheatsheet<CR>]], opts)
|
||||
keymap("n", "<leader>tf", [[<Cmd>Telescope find_files<CR>]], opts)
|
||||
keymap("n", "<leader>tfa", [[<Cmd>Telescope find_files hidden=true<CR>]], opts)
|
||||
keymap("n", "<leader>tfb", [[<Cmd>Telescope file_browser<CR>]], opts)
|
||||
keymap("n", "<leader>tg", [[<Cmd>Telescope tags<CR>]], opts)
|
||||
keymap("n", "<leader>tlg", [[<Cmd>Telescope live_grep<CR>]], opts)
|
||||
keymap("n", "<leader>tr", [[<Cmd>Telescope resume<CR>]], opts)
|
||||
|
||||
-- Setup
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
path_display = {
|
||||
"smart",
|
||||
},
|
||||
file_ignore_pattern = {
|
||||
"yarn.lock",
|
||||
},
|
||||
mappings = {
|
||||
-- INSERT Mode
|
||||
i = {
|
||||
["<C-n>"] = actions.cycle_history_next,
|
||||
["<C-p>"] = actions.cycle_history_prev,
|
||||
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
|
||||
["<C-c>"] = actions.close,
|
||||
|
||||
["<Down>"] = actions.move_selection_next,
|
||||
["<Up>"] = actions.move_selection_previous,
|
||||
|
||||
["<CR>"] = actions.select_default,
|
||||
["<C-x>"] = actions.select_horizontal,
|
||||
["<C-v>"] = actions.select_vertical,
|
||||
["<C-t>"] = actions.select_tab,
|
||||
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
|
||||
["<PageUp>"] = actions.results_scrolling_up,
|
||||
["<PageDown>"] = actions.results_scrolling_down,
|
||||
|
||||
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
|
||||
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
|
||||
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
["<C-l>"] = actions.complete_tag,
|
||||
["<C-_>"] = actions.which_key, -- keys from pressing <C-/>
|
||||
},
|
||||
-- NORMAL Mode
|
||||
n = {
|
||||
["<esc>"] = actions.close,
|
||||
["<CR>"] = actions.select_default,
|
||||
["<C-x>"] = actions.select_horizontal,
|
||||
["<C-v>"] = actions.select_vertical,
|
||||
["<C-t>"] = actions.select_tab,
|
||||
|
||||
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
|
||||
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
|
||||
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
|
||||
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
|
||||
["j"] = actions.move_selection_next,
|
||||
["k"] = actions.move_selection_previous,
|
||||
["H"] = actions.move_to_top,
|
||||
["M"] = actions.move_to_middle,
|
||||
["L"] = actions.move_to_bottom,
|
||||
|
||||
["<Down>"] = actions.move_selection_next,
|
||||
["<Up>"] = actions.move_selection_previous,
|
||||
["gg"] = actions.move_to_top,
|
||||
["G"] = actions.move_to_bottom,
|
||||
|
||||
["<C-u>"] = actions.preview_scrolling_up,
|
||||
["<C-d>"] = actions.preview_scrolling_down,
|
||||
|
||||
["<PageUp>"] = actions.results_scrolling_up,
|
||||
["<PageDown>"] = actions.results_scrolling_down,
|
||||
|
||||
["?"] = actions.which_key,
|
||||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
buffers = {
|
||||
theme = "dropdown",
|
||||
previewer = false,
|
||||
show_all_buffers = true,
|
||||
sort_lastused = true,
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true,
|
||||
override_generic_sorter = true,
|
||||
override_file_sorter = true,
|
||||
case_mode = "smart_case",
|
||||
},
|
||||
file_browser = {
|
||||
theme = "ivy",
|
||||
hijack_netrw = true,
|
||||
},
|
||||
frecency = {
|
||||
show_scores = false,
|
||||
show_unindexed = true,
|
||||
ignore_patterns = {
|
||||
"*.git/*",
|
||||
"*/tmp/*",
|
||||
},
|
||||
disable_devicons = false,
|
||||
},
|
||||
bookmarks = {
|
||||
selected_browser = "brave",
|
||||
url_open_command = "open",
|
||||
},
|
||||
lsp_handlers = {
|
||||
disable = {},
|
||||
location = {
|
||||
telescope = {},
|
||||
no_results_message = "No references found",
|
||||
},
|
||||
symbol = {
|
||||
telescope = {},
|
||||
no_results_message = "No symbols found",
|
||||
},
|
||||
call_hierarchy = {
|
||||
telescope = {},
|
||||
no_results_message = "No calls found",
|
||||
},
|
||||
code_action = {
|
||||
telescope = require("telescope.themes").get_dropdown({}),
|
||||
no_results_message = "No code actions available",
|
||||
prefix = "",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -1,107 +0,0 @@
|
||||
local status_ok, toggleterm = pcall(require, "toggleterm")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
toggleterm.setup({
|
||||
size = 20,
|
||||
open_mapping = [[<C-t>]],
|
||||
hide_numbers = true,
|
||||
shade_filetypes = {},
|
||||
shade_terminals = true,
|
||||
shading_factor = 2,
|
||||
start_in_insert = true,
|
||||
insert_mappings = true,
|
||||
persist_size = true,
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
shell = vim.o.shell,
|
||||
float_opts = {
|
||||
border = "curved",
|
||||
winblend = 0,
|
||||
highlights = {
|
||||
border = "Normal",
|
||||
background = "Normal",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
function _G.set_terminal_keymaps()
|
||||
local opts = {
|
||||
noremap = true,
|
||||
}
|
||||
local keymap = vim.api.nvim_buf_set_keymap
|
||||
|
||||
keymap(0, "t", "<esc>", [[<C-\><C-n>]], opts)
|
||||
keymap(0, "t", "<C-h>", [[<C-\><C-n><C-W>h]], opts)
|
||||
keymap(0, "t", "<C-j>", [[<C-\><C-n><C-W>j]], opts)
|
||||
keymap(0, "t", "<C-k>", [[<C-\><C-n><C-W>k]], opts)
|
||||
keymap(0, "t", "<C-l>", [[<C-\><C-n><C-W>l]], opts)
|
||||
end
|
||||
|
||||
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")
|
||||
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local lazygit = Terminal:new({
|
||||
cmd = "lazygit",
|
||||
hidden = true,
|
||||
})
|
||||
|
||||
function _LAZYGIT_TOGGLE()
|
||||
lazygit:toggle()
|
||||
end
|
||||
|
||||
local tig = Terminal:new({
|
||||
cmd = "tig",
|
||||
hidden = true,
|
||||
})
|
||||
|
||||
function _TIG_TOGGLE()
|
||||
tig:toggle()
|
||||
end
|
||||
|
||||
local node = Terminal:new({
|
||||
cmd = "node",
|
||||
hidden = true,
|
||||
})
|
||||
|
||||
function _NODE_TOGGLE()
|
||||
node:toggle()
|
||||
end
|
||||
|
||||
local ncdu = Terminal:new({
|
||||
cmd = "ncdu",
|
||||
hidden = true,
|
||||
})
|
||||
|
||||
function _NCDU_TOGGLE()
|
||||
ncdu:toggle()
|
||||
end
|
||||
|
||||
local htop = Terminal:new({
|
||||
cmd = "htop",
|
||||
hidden = true,
|
||||
})
|
||||
|
||||
function _HTOP_TOGGLE()
|
||||
htop:toggle()
|
||||
end
|
||||
|
||||
local python = Terminal:new({
|
||||
cmd = "python",
|
||||
hidden = true,
|
||||
})
|
||||
|
||||
function _PYTHON_TOGGLE()
|
||||
python:toggle()
|
||||
end
|
||||
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true}
|
||||
|
||||
-- Keymaps
|
||||
keymap("n", "<leader>lg", "<cmd>lua _LAZYGIT_TOGGLE()<CR>", opts)
|
||||
keymap("n", "<leader>node", "<cmd>lua _NODE_TOGGLE()<CR>", opts)
|
||||
keymap("n", "<leader>py", "<cmd>lua _PYTHON_TOGGLE()<CR>", opts)
|
||||
keymap("n", "<leader>top", "<cmd>lua _HTOP_TOGGLE()<CR>", opts)
|
||||
keymap("n", "<leader>ncdu", "<cmd>lua _NCDU_TOGGLE()<CR>", opts)
|
||||
@@ -1,32 +0,0 @@
|
||||
-- nvim-treesitter – https://github.com/nvim-treesitter/nvim-treesitter/
|
||||
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
configs.setup({
|
||||
ensure_installed = "all",
|
||||
sync_install = false,
|
||||
ignore_install = { "" }, -- List of parsers to ignore installing
|
||||
autopairs = {
|
||||
enable = true,
|
||||
},
|
||||
highlight = {
|
||||
enable = true, -- false will disable the whole extension
|
||||
disable = { "" }, -- list of language that will be disabled
|
||||
additional_vim_regex_highlighting = true,
|
||||
},
|
||||
indent = { enable = true, disable = { "yaml", "css" } },
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
enable_autocmd = false,
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
|
||||
max_file_lines = nil, -- Do not enable for files with more than n lines, int
|
||||
},
|
||||
playground = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
@@ -1,12 +0,0 @@
|
||||
-- vim-easymotion – https://github.com/easymotion/vim-easymotion
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
-- Keymaps
|
||||
-- <Leader>f{char} to move to {char}
|
||||
keymap("", "<leader>l", [[<Plug>(easymotion-bd-f)]], opts)
|
||||
keymap("n", "<leader>l", [[<Plug>(easymotion-overwin-f)]], opts)
|
||||
|
||||
-- Move to line
|
||||
keymap("", "<leader>L", [[<Plug>(easymotion-bd-jk)]], opts)
|
||||
keymap("n", "<leader>L", [[<Plug>(easymotion-overwin-line)]], opts)
|
||||
@@ -1,3 +0,0 @@
|
||||
-- vim-gh-line – https://github.com/ruanyl/vim-gh-line
|
||||
|
||||
vim.g.gh_github_domain = "source.xing.com"
|
||||
@@ -1,15 +0,0 @@
|
||||
-- Vimux – https://github.com/preservim/vimux
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
vim.g.VimuxHeight = "30"
|
||||
vim.g.VimuxOrientation = "h"
|
||||
vim.g.VimuxUseNearestPane = 0
|
||||
|
||||
-- Keymaps
|
||||
keymap("n", "<leader>vt", [[<cmd>VimuxTogglePane<CR>]], opts)
|
||||
keymap("n", "<leader>vp", [[<cmd>VimuxPromptCommand<CR>]], opts)
|
||||
keymap("n", "<leader>vl", [[<cmd>VimuxRunLastCommand<CR>]], opts)
|
||||
keymap("n", "<leader>vj", [[<cmd>RunJest<CR>]], opts)
|
||||
keymap("n", "<leader>vjb", [[<cmd>RunJestOnBuffer<CR>]], opts)
|
||||
keymap("n", "<leader>vjf", [[<cmd>RunJestFocused<CR>]], opts)
|
||||
@@ -1,259 +0,0 @@
|
||||
local status_ok, which_key = pcall(require, "which-key")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local mappings = {
|
||||
b = {
|
||||
"<CMD>lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{previewer = false})<CR>",
|
||||
"Buffers",
|
||||
},
|
||||
c = { "<CMD>lua require('Comment.api').toggle_current_linewise()<CR>", "Comment" },
|
||||
d = { "<CMD>TroubleToggle<CR>", "Diagnostics" },
|
||||
e = { "<CMD>NvimTreeToggle<CR>", "Explorer" },
|
||||
f = { "<CMD>FzfLua files<CR>", "Find Files" },
|
||||
h = { "<CMD>nohlsearch<CR>", "No Highlight" },
|
||||
i = { "<CMD>silent !open -a iA\\ Writer.app '%:p'<CR>", "Open in iA Writer" },
|
||||
j = { "<CMD>b#<CR>", "Toggle Buffers" },
|
||||
p = { "<CMD>Telescope projects<CR>", "Projects" },
|
||||
q = { "<CMD>Bdelete!<CR>", "Close Buffer" },
|
||||
s = {
|
||||
a = { "<Cmd>:FzfLua lsp_code_actions<CR>", "LSP Code Actions" },
|
||||
d = { "<Cmd>:FzfLua lsp_definitions<CR>", "LSP Definitions" },
|
||||
s = { "<Cmd>:FzfLua lsp_document_symbols<CR>", "LSP Document Symbols" },
|
||||
w = { "<Cmd>:FzfLua lsp_live_workspace_symbols<CR>", "LSP Live Workspace Symbols" },
|
||||
r = { "<Cmd>:FzfLua lsp_references<CR>", "LSP References" },
|
||||
t = { "<Cmd>:FzfLua lsp_typedef<CR>", "LSP Type Definition" },
|
||||
name = "Search",
|
||||
F = {
|
||||
name = "FZF",
|
||||
b = { "<Cmd>:FzfLua blines<CR>", "Bufferlines" },
|
||||
f = { "<Cmd>:FzfLua files<CR>", "Files" },
|
||||
h = { "<Cmd>:FzfLua oldfiles<CR>", "Open Files History" },
|
||||
i = { "<Cmd>:FzfLua spell_suggest<CR>", "Spelling Suggestions" },
|
||||
m = { "<Cmd>:FzfLua marks<CR>", "Marks" },
|
||||
o = { "<Cmd>:FzfLua lines<CR>", "Open Buffer Lines" },
|
||||
q = { "<Cmd>:FzfLua quickfix<CR>", "Quickfix" },
|
||||
r = { "<Cmd>:FzfLua resume<CR>", "Resume last command" },
|
||||
t = { "<Cmd>:FzfLua tabs<CR>", "Tabs" },
|
||||
g = {
|
||||
name = "Git",
|
||||
b = { "<Cmd>:FzfLua git_branches<CR>", "Git Branches" },
|
||||
c = { "<Cmd>:FzfLua git_commits<CR>", "Git Commits" },
|
||||
s = { "<Cmd>:FzfLua git_stash<CR>", "Git Stashes" },
|
||||
t = { "<Cmd>:FzfLua git_status<CR>", "Git Status" },
|
||||
},
|
||||
s = {
|
||||
name = "Search",
|
||||
s = { "<Cmd>:FzfLua grep<CR>", "Grep Search" },
|
||||
i = { "<Cmd>:FzfLua live_grep<CR>", "Live Grep" },
|
||||
l = { "<Cmd>:FzfLua grep_last<CR>", "Last Grep Search" },
|
||||
r = { "<Cmd>:FzfLua live_grep_resume<CR>", "Resume Last Search" },
|
||||
c = { "<Cmd>:FzfLua grep_cword<CR>", "Search Word Under Cursor" },
|
||||
v = { "<Cmd>:FzfLua grep_visual<CR>", "Search Visual Selection" },
|
||||
p = { "<Cmd>:FzfLua grep_project<CR>", "Grep Search in Project" },
|
||||
},
|
||||
},
|
||||
T = {
|
||||
name = "Telescope",
|
||||
u = { "<Cmd>Telescope frecency<CR>", "MRU (Frequency)" },
|
||||
r = { "<Cmd>Telescope resume<CR>", "Resume last search" },
|
||||
b = { "<Cmd>Telescope bookmarks<CR>", "Browser Bookmarks" },
|
||||
m = { "<Cmd>Telescope marks<CR>", "Marks" },
|
||||
n = { "<Cmd>Telescope node_modules list<CR>", "Node Modules" },
|
||||
k = { "<Cmd>Telescope keymaps<CR>", "Keymaps" },
|
||||
h = { "<Cmd>Telescope help_tags<CR>", "Help Tags" },
|
||||
t = { "<Cmd>Telescope tags<CR>", "Tags" },
|
||||
f = {
|
||||
name = "Find",
|
||||
s = { "<Cmd>Telescope find_files<CR>", "Find Files" },
|
||||
a = { "<Cmd>Telescope find_files hidden=true<CR>", "Find all files" },
|
||||
f = { "<Cmd>Telescope file_browser<CR>", "File Browser" },
|
||||
l = { "<Cmd>Telescope live_grep<CR>", "Live Grep" },
|
||||
},
|
||||
g = {
|
||||
name = "Git",
|
||||
b = { "<Cmd>Telescope git_branches<CR>", "Git Branches" },
|
||||
s = { "<Cmd>Telescope git_status<CR>", "Git Status" },
|
||||
},
|
||||
},
|
||||
S = {
|
||||
name = "Spectre",
|
||||
f = { "<CMD>lua require('spectre').open_file_search()<CR>", "File Search" },
|
||||
c = { "<CMD>lua require('spectre').open_visual({select_word=true})<CR>", "Search Current Word" },
|
||||
},
|
||||
},
|
||||
t = {
|
||||
name = "Terminal",
|
||||
f = { "<CMD>ToggleTerm direction=float<CR>", "Float" },
|
||||
g = { "<CMD>lua _TIG_TOGGLE()<CR>", "TIG" },
|
||||
h = { "<CMD>ToggleTerm size=10 direction=horizontal<CR>", "Horizontal" },
|
||||
l = { "<CMD>lua _LAZYGIT_TOGGLE()<CR>", "LazyGit" },
|
||||
n = { "<CMD>lua _NODE_TOGGLE()<CR>", "Node" },
|
||||
p = { "<CMD>lua _PYTHON_TOGGLE()<CR>", "Python" },
|
||||
t = { "<CMD>lua _HTOP_TOGGLE()<CR>", "Htop" },
|
||||
u = { "<CMD>lua _NCDU_TOGGLE()<CR>", "NCDU" },
|
||||
v = { "<CMD>ToggleTerm size=80 direction=vertical<CR>", "Vertical" },
|
||||
},
|
||||
v = { "<CMD>lua require('export-to-vscode').launch()<CR>", "Export to Visual Studio Code" },
|
||||
w = { "<CMD>w!<CR>", "Save" },
|
||||
z = {
|
||||
name = "Zen",
|
||||
g = { "<CMD>Goyo<CR>", "Goyo" },
|
||||
z = { "<CMD>ZenMode<CR>", "ZenMode" },
|
||||
t = { "<CMD>Twilight<CR>", "Twilight Mode" },
|
||||
},
|
||||
A = { "<CMD>Alpha<CR>", "Alpha" },
|
||||
B = {
|
||||
name = "Bufferline",
|
||||
p = { "<CMD>BufferLinePick<CR>", "Pick" },
|
||||
x = { "<CMD>BufferLinePickClose<CR>", "Pick to Close" },
|
||||
},
|
||||
E = {
|
||||
name = "Explorer",
|
||||
a = { "<CMD>NvimTreeFocus<CR>", "Focus" },
|
||||
c = { "<CMD>NvimTreeCollapse<CR>", "Collapse Folders" },
|
||||
f = { "<CMD>NvimTreeFindFile<CR>", "Find File" },
|
||||
r = { "<CMD>NvimTreeRefresh<CR>", "Refresh" },
|
||||
},
|
||||
F = { "<CMD>FzfLua live_grep<CR>", "Find Text" },
|
||||
G = {
|
||||
name = "Git & GitHub",
|
||||
b = { "<CMD>BlamerToggle<CR>", "Blame Line" },
|
||||
g = { "<CMD>GBInteractive<CR>", "Git Blame in GitHub" },
|
||||
h = { "<CMD>GHInteractive<CR>", "Open in GitHub" },
|
||||
},
|
||||
L = {
|
||||
name = "LSP",
|
||||
c = { "<CMD>vim.lsp.buf.code_action<CR>", "Code Action" },
|
||||
b = { "<CMD>FzfLua blines<CR>", "Buffer Lines" },
|
||||
f = { "<CMD>vim.lsp.buf.formatting<CR>", "Formatting" },
|
||||
l = { "<CMD>vim.diagnostic.setloclist<CR>", "Set Loclist" },
|
||||
r = { "<CMD>vim.lsp.buf.rename<CR>", "Rename" },
|
||||
t = { "<CMD>vim.lsp.buf.type_definition<CR>", "Type Definition" },
|
||||
w = { "<CMD>function() print(vim.inspect(vim.lsp.buf.list_workspace_folders()))", "List Workspace Folder" },
|
||||
a = { "<CMD>vim.lsp.buf.add_workspace_folder<CR>", "Add Workspace" },
|
||||
v = { "<CMD>vim.lsp.buf.remove_workspace_folder<CR>", "Remove Workspace" },
|
||||
},
|
||||
P = {
|
||||
name = "Packer",
|
||||
c = { "<CMD>PackerCompile<CR>", "Compile" },
|
||||
i = { "<CMD>PackerInstall<CR>", "Install" },
|
||||
s = { "<CMD>PackerSync<CR>", "Sync" },
|
||||
S = { "<CMD>PackerStatus<CR>", "Status" },
|
||||
u = { "<CMD>PackerUpdate<CR>", "Update" },
|
||||
},
|
||||
Q = { "<CMD>q!<CR>", "Quit" },
|
||||
R = { "<CMD>luafile %<CR>", "Reload File" },
|
||||
T = {
|
||||
name = "Text Editing",
|
||||
s = { "<CMD>:set spell!<CR>", "Spell Checking" },
|
||||
d = { "<CMD>call SpellEn()<CR>", "Set Spelling Language to English" },
|
||||
e = { "<CMD>call SpellDe()<CR>", "Set Spelling Languate to German" },
|
||||
w = { "<CMD>call ToggleWrap()<CR>", "Soft wrap/No wrap" },
|
||||
c = { "<CMD>call ToggleColorColumn()<CR>", "Show/Hide Colorcolumn" },
|
||||
m = { "<CMD>MarkdownPreviewToggle<CR>", "Markdown Preview" },
|
||||
},
|
||||
V = {
|
||||
name = "Vimux",
|
||||
p = { "<CMD>VimuxPromptCommand<CR>", "Run Prompt Command" },
|
||||
l = { "<CMD>VimuxRunLastCommand<CR>", "Run Last Command" },
|
||||
t = { "<CMD>VimuxTogglePane<CR>", "Toggle Pane" },
|
||||
j = { "<CMD>RunJest<CR>", "Run Jest" },
|
||||
b = { "<CMD>RunJestOnBuffer<CR>", "Run Jest on Buffer" },
|
||||
f = { "<CMD>RunJestFocused<CR>", "Run Jest on Focused" },
|
||||
},
|
||||
W = { "<CMD>wa!<CR>", "Save All" },
|
||||
}
|
||||
|
||||
local 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 = 20, -- 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
|
||||
},
|
||||
popup_mappings = {
|
||||
scroll_down = "<c-d>", -- binding to scroll down inside the popup
|
||||
scroll_up = "<c-u>", -- binding to scroll up inside the popup
|
||||
},
|
||||
window = {
|
||||
border = "rounded", -- none, single, double, shadow
|
||||
position = "bottom", -- bottom, top
|
||||
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
|
||||
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
|
||||
winblend = 0,
|
||||
},
|
||||
layout = {
|
||||
height = { min = 4, max = 25 }, -- min and max height of the columns
|
||||
width = { min = 20, max = 50 }, -- min and max width of the columns
|
||||
spacing = 3, -- spacing between columns
|
||||
align = "left", -- align columns left, center or right
|
||||
},
|
||||
ignore_missing = true, -- 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
|
||||
i = { "j", "k" },
|
||||
v = { "j", "k" },
|
||||
},
|
||||
}
|
||||
|
||||
local opts = {
|
||||
mode = "n", -- NORMAL mode
|
||||
prefix = "<leader>",
|
||||
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
||||
silent = true, -- use `silent` when creating keymaps
|
||||
noremap = true, -- use `noremap` when creating keymaps
|
||||
nowait = true, -- use `nowait` when creating keymaps
|
||||
}
|
||||
|
||||
local vopts = {
|
||||
mode = "v", -- VISUAL mode
|
||||
prefix = "<leader>",
|
||||
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
||||
silent = true, -- use `silent` when creating keymaps
|
||||
noremap = true, -- use `noremap` when creating keymaps
|
||||
nowait = true, -- use `nowait` when creating keymaps
|
||||
}
|
||||
|
||||
local vmappings = {
|
||||
["/"] = { '<ESC><CMD>lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())<CR>', "Comment" },
|
||||
}
|
||||
|
||||
which_key.setup(setup)
|
||||
which_key.register(mappings, opts)
|
||||
which_key.register(vmappings, vopts)
|
||||
Reference in New Issue
Block a user