moar plugins
This commit is contained in:
parent
84509df6a0
commit
9281537c59
|
@ -10,7 +10,7 @@ opt.spelllang = "en,de"
|
||||||
opt.clipboard = "" -- don't just use the system clipboard
|
opt.clipboard = "" -- don't just use the system clipboard
|
||||||
opt.wrap = false
|
opt.wrap = false
|
||||||
opt.breakindent = false
|
opt.breakindent = false
|
||||||
opt.spell = true
|
opt.spell = false
|
||||||
opt.list = true
|
opt.list = true
|
||||||
opt.conceallevel = 2
|
opt.conceallevel = 2
|
||||||
opt.undofile = true
|
opt.undofile = true
|
||||||
|
@ -33,9 +33,9 @@ opt.shiftround = true -- Round indent to multiple of 'shiftwidth'
|
||||||
-- Timing
|
-- Timing
|
||||||
-- ===
|
-- ===
|
||||||
opt.ttimeout = true
|
opt.ttimeout = true
|
||||||
opt.timeoutlen = 500 -- Time out on mappings
|
opt.timeoutlen = 500 -- Time out on mappings
|
||||||
opt.ttimeoutlen = 10 -- Time out on key codes
|
opt.ttimeoutlen = 10 -- Time out on key codes
|
||||||
opt.updatetime = 500 -- Idle time to write swap and trigger CursorHold
|
opt.updatetime = 500 -- Idle time to write swap and trigger CursorHold
|
||||||
|
|
||||||
-- Searching
|
-- Searching
|
||||||
-- ===
|
-- ===
|
||||||
|
@ -47,14 +47,14 @@ opt.incsearch = true -- Incremental search
|
||||||
-- Formatting
|
-- Formatting
|
||||||
-- ===
|
-- ===
|
||||||
|
|
||||||
opt.wrap = false -- No wrap by default
|
opt.wrap = false -- No wrap by default
|
||||||
opt.linebreak = true -- Break long lines at 'breakat'
|
opt.linebreak = true -- Break long lines at 'breakat'
|
||||||
opt.breakat = '\\ \\ ;:,!?' -- Long lines break chars
|
opt.breakat = '\\ \\ ;:,!?' -- Long lines break chars
|
||||||
opt.startofline = false -- Cursor in same column for few commands
|
opt.startofline = false -- Cursor in same column for few commands
|
||||||
opt.splitbelow = true -- Splits open bottom right
|
opt.splitbelow = true -- Splits open bottom right
|
||||||
opt.splitright = true
|
opt.splitright = true
|
||||||
opt.breakindentopt = { shift = 2, min = 20 }
|
opt.breakindentopt = { shift = 2, min = 20 }
|
||||||
opt.formatoptions = "cqanlmBjp" -- see :h fo-table & :h formatoptions
|
opt.formatoptions = "qnlmBjp" -- see :h fo-table & :h formatoptions
|
||||||
|
|
||||||
-- Diff
|
-- Diff
|
||||||
-- ===
|
-- ===
|
||||||
|
@ -67,69 +67,78 @@ opt.wildmode = 'longest:full,full' -- Command-line completion mode
|
||||||
|
|
||||||
opt.termguicolors = true
|
opt.termguicolors = true
|
||||||
opt.shortmess = "xsTOInfFitloCaAs"
|
opt.shortmess = "xsTOInfFitloCaAs"
|
||||||
opt.showmode = true -- Show mode in cmd window
|
opt.showmode = true -- Show mode in cmd window
|
||||||
opt.scrolloff = 2 -- Keep at least n lines above/below
|
opt.scrolloff = 2 -- Keep at least n lines above/below
|
||||||
opt.sidescrolloff = 0 -- Keep at least n lines left/right
|
opt.sidescrolloff = 0 -- Keep at least n lines left/right
|
||||||
opt.numberwidth = 2 -- Minimum number of columns to use for the line number
|
opt.numberwidth = 2 -- Minimum number of columns to use for the line number
|
||||||
opt.number = true -- Show line numbers
|
opt.number = true -- Show line numbers
|
||||||
opt.ruler = false -- Default status ruler
|
opt.ruler = false -- Default status ruler
|
||||||
opt.list = true -- Show hidden characters
|
opt.list = true -- Show hidden characters
|
||||||
|
|
||||||
if vim.g.started_by_firenvim == false then
|
if vim.g.started_by_firenvim == false then
|
||||||
opt.showtabline = 3 -- Always show the tabs line
|
opt.showtabline = 3 -- Always show the tabs line
|
||||||
opt.laststatus = 3 -- Always show laststatus
|
opt.laststatus = 3 -- Always show laststatus
|
||||||
else
|
else
|
||||||
opt.showtabline = 1 -- Don't show tabline in firenvim, unless multitab
|
opt.showtabline = 1 -- Don't show tabline in firenvim, unless multitab
|
||||||
opt.laststatus = 3 -- Don't show laststatus in firenvim
|
opt.laststatus = 3 -- Don't show laststatus in firenvim
|
||||||
end
|
end
|
||||||
opt.helpheight = 0 -- Disable help window resizing
|
opt.helpheight = 0 -- Disable help window resizing
|
||||||
opt.winwidth = 30 -- Minimum width for active window
|
opt.winwidth = 30 -- Minimum width for active window
|
||||||
opt.winminwidth = 1 -- Minimum width for inactive windows
|
opt.winminwidth = 1 -- Minimum width for inactive windows
|
||||||
opt.winheight = 1 -- Minimum height for active window
|
opt.winheight = 1 -- Minimum height for active window
|
||||||
opt.winminheight = 1 -- Minimum height for inactive window
|
opt.winminheight = 1 -- Minimum height for inactive window
|
||||||
|
|
||||||
opt.showcmd = false -- show command in status line
|
opt.showcmd = false -- show command in status line
|
||||||
opt.cmdheight = 0
|
opt.cmdheight = 0
|
||||||
opt.cmdwinheight = 5 -- Command-line lines
|
opt.cmdwinheight = 5 -- Command-line lines
|
||||||
opt.equalalways = true -- Resize windows on split or close
|
opt.equalalways = true -- Resize windows on split or close
|
||||||
opt.colorcolumn = '+0' -- Column highlight at textwidth's max character-limit
|
opt.colorcolumn = '+0' -- Column highlight at textwidth's max character-limit
|
||||||
|
|
||||||
opt.cursorline = true
|
opt.cursorline = true
|
||||||
opt.cursorlineopt = { 'number', 'screenline' }
|
opt.cursorlineopt = { 'number', 'screenline' }
|
||||||
|
|
||||||
opt.pumheight = 10 -- Maximum number of items to show in the popup menu
|
opt.pumheight = 10 -- Maximum number of items to show in the popup menu
|
||||||
opt.pumwidth = 10 -- Minimum width for the popup menu
|
opt.pumwidth = 10 -- Minimum width for the popup menu
|
||||||
opt.pumblend = 10 -- Popup blend
|
opt.pumblend = 10 -- Popup blend
|
||||||
|
|
||||||
|
|
||||||
-- autocommands
|
-- autocommands
|
||||||
-- ===
|
-- ===
|
||||||
local function augroup(name)
|
local function augroup(name)
|
||||||
return vim.api.nvim_create_augroup("plex_" .. name, {})
|
return vim.api.nvim_create_augroup("plex_" .. name, {})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- highlight on yank
|
-- highlight on yank
|
||||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
group = augroup "highlight_yank",
|
group = augroup "highlight_yank",
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.highlight.on_yank()
|
vim.highlight.on_yank()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Disable conceallevel for specific file-types.
|
-- Disable conceallevel for specific file-types.
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
group = augroup('fix_conceallevel'),
|
group = augroup('fix_conceallevel'),
|
||||||
pattern = { 'latex', 'tex' },
|
pattern = { 'latex', 'tex' },
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.opt_local.conceallevel = 0
|
vim.opt_local.conceallevel = 0
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Resize splits if window got resized
|
-- Resize splits if window got resized
|
||||||
vim.api.nvim_create_autocmd('VimResized', {
|
vim.api.nvim_create_autocmd('VimResized', {
|
||||||
group = augroup('resize_splits'),
|
group = augroup('resize_splits'),
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.cmd('wincmd =')
|
vim.cmd('wincmd =')
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Wrap and enable spell-checker in text filetypes
|
||||||
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
|
group = augroup('spell_conceal'),
|
||||||
|
pattern = { 'gitcommit', 'markdown', 'tex', 'latex', 'norg' },
|
||||||
|
callback = function()
|
||||||
|
vim.opt_local.spell = true
|
||||||
|
vim.opt_local.conceallevel = 0
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
|
@ -1,41 +1,44 @@
|
||||||
---@type MappingsTable
|
---@type MappingsTable
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
|
-- NOTE: The mappings here are case sensitive!!! Removing a specific default
|
||||||
|
-- mapping requires the same case here!
|
||||||
M.disabled = {
|
M.disabled = {
|
||||||
n = {
|
n = {
|
||||||
["<C-a>"] = "",
|
["<C-a>"] = "",
|
||||||
["<C-s>"] = "",
|
["<C-s>"] = "",
|
||||||
["<C-c>"] = "",
|
["<C-c>"] = "",
|
||||||
["<LEADER>n"] = "",
|
["<leader>n"] = "",
|
||||||
["<LEADER>rn"] = "",
|
["<leader>rn"] = "",
|
||||||
["<UP>"] = "",
|
["<Up>"] = "",
|
||||||
["<DOWN>"] = "",
|
["<Down>"] = "",
|
||||||
["<LEADER>x"] = "",
|
["<leader>x"] = "",
|
||||||
["<LEADER>/"] = "",
|
["<leader>/"] = "",
|
||||||
["<LEADER>ra"] = "",
|
["<leader>ra"] = "",
|
||||||
["[d"] = "",
|
["[d"] = "",
|
||||||
["]d"] = "",
|
["]d"] = "",
|
||||||
["[c"] = "",
|
["[c"] = "",
|
||||||
["]c"] = "",
|
["]c"] = "",
|
||||||
["<LEADER>h"] = "",
|
["<leader>h"] = "",
|
||||||
["<LEADER>ff"] = "",
|
["<leader>ff"] = "",
|
||||||
["<LEADER>fm"] = "",
|
["<leader>fm"] = "",
|
||||||
["<LEADER>fa"] = "",
|
["<leader>fa"] = "",
|
||||||
["<LEADER>fw"] = "",
|
["<leader>fw"] = "",
|
||||||
["<LEADER>fb"] = "",
|
["<leader>fb"] = "",
|
||||||
["<LEADER>fh"] = "",
|
["<leader>fh"] = "",
|
||||||
["<LEADER>fo"] = "",
|
["<leader>fo"] = "",
|
||||||
["<LEADER>fz"] = "",
|
["<leader>fz"] = "",
|
||||||
["<LEADER>cm"] = "",
|
["<leader>cm"] = "",
|
||||||
["<LEADER>gt"] = "",
|
["<leader>gt"] = "",
|
||||||
["<LEADER>pt"] = "",
|
["<leader>pt"] = "",
|
||||||
["<LEADER>th"] = "",
|
["<leader>th"] = "",
|
||||||
["<LEADER>ma"] = "",
|
["<leader>ma"] = "",
|
||||||
["<LEADER>v"] = "",
|
["<leader>v"] = "",
|
||||||
["<LEADER>rh"] = "",
|
["<leader>rh"] = "",
|
||||||
["<LEADER>ph"] = "",
|
["<leader>ph"] = "",
|
||||||
["<LEADER>gb"] = "",
|
["<leader>gb"] = "",
|
||||||
["<LEADER>td"] = "",
|
["<leader>td"] = "",
|
||||||
|
["<leader>wk"] = "",
|
||||||
["#"] = "",
|
["#"] = "",
|
||||||
["?"] = "",
|
["?"] = "",
|
||||||
},
|
},
|
||||||
|
@ -45,7 +48,7 @@ M.disabled = {
|
||||||
v = {
|
v = {
|
||||||
["#"] = "",
|
["#"] = "",
|
||||||
["?"] = "",
|
["?"] = "",
|
||||||
["<LEADER>/"] = "",
|
["<leader>/"] = "",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +57,7 @@ M.tabufline = {
|
||||||
|
|
||||||
n = {
|
n = {
|
||||||
-- cycle through buffers
|
-- cycle through buffers
|
||||||
["<TAB>"] = {
|
["<Tab>"] = {
|
||||||
function()
|
function()
|
||||||
require("nvchad.tabufline").tabuflineNext()
|
require("nvchad.tabufline").tabuflineNext()
|
||||||
end,
|
end,
|
||||||
|
@ -83,7 +86,7 @@ M.comment = {
|
||||||
|
|
||||||
-- toggle comment in both modes
|
-- toggle comment in both modes
|
||||||
n = {
|
n = {
|
||||||
["<LEADER>v"] = {
|
["<leader>v"] = {
|
||||||
function()
|
function()
|
||||||
require("Comment.api").toggle.linewise.current()
|
require("Comment.api").toggle.linewise.current()
|
||||||
end,
|
end,
|
||||||
|
@ -92,8 +95,8 @@ M.comment = {
|
||||||
},
|
},
|
||||||
|
|
||||||
v = {
|
v = {
|
||||||
["<LEADER>v"] = {
|
["<leader>v"] = {
|
||||||
"<ESC><CMD>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<CR>",
|
"<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>",
|
||||||
"Toggle comment",
|
"Toggle comment",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -102,44 +105,44 @@ M.comment = {
|
||||||
M.leap = {
|
M.leap = {
|
||||||
plugin = true,
|
plugin = true,
|
||||||
n = {
|
n = {
|
||||||
["<LEADER>s"] = {
|
["<leader>s"] = {
|
||||||
"<PLUG>(leap-forward)",
|
"<plug>(leap-forward)",
|
||||||
"leap forward",
|
"leap forward",
|
||||||
},
|
},
|
||||||
["<LEADER>S"] = {
|
["<leader>S"] = {
|
||||||
"<PLUG>(leap-backward)",
|
"<plug>(leap-backward)",
|
||||||
"leap backward",
|
"leap backward",
|
||||||
},
|
},
|
||||||
["<LEADER>gs"] = {
|
["<leader>gs"] = {
|
||||||
"<PLUG>(leap-from-window)",
|
"<plug>(leap-from-window)",
|
||||||
"leap from window",
|
"leap from window",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
x = {
|
x = {
|
||||||
["<LEADER>s"] = {
|
["<leader>s"] = {
|
||||||
"<PLUG>(leap-forward)",
|
"<plug>(leap-forward)",
|
||||||
"leap forward",
|
"leap forward",
|
||||||
},
|
},
|
||||||
["<LEADER>S"] = {
|
["<leader>S"] = {
|
||||||
"<PLUG>(leap-backward)",
|
"<plug>(leap-backward)",
|
||||||
"leap forward",
|
"leap forward",
|
||||||
},
|
},
|
||||||
["<LEADER>gs"] = {
|
["<leader>gs"] = {
|
||||||
"<PLUG>(leap-from-window)",
|
"<plug>(leap-from-window)",
|
||||||
"leap from window",
|
"leap from window",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
o = {
|
o = {
|
||||||
["<LEADER>s"] = {
|
["<leader>s"] = {
|
||||||
"<PLUG>(leap-forward)",
|
"<plug>(leap-forward)",
|
||||||
"leap forward",
|
"leap forward",
|
||||||
},
|
},
|
||||||
["<LEADER>S"] = {
|
["<leader>S"] = {
|
||||||
"<PLUG>(leap-backward)",
|
"<plug>(leap-backward)",
|
||||||
"leap forward",
|
"leap forward",
|
||||||
},
|
},
|
||||||
["<LEADER>gs"] = {
|
["<leader>gs"] = {
|
||||||
"<PLUG>(leap-from-window)",
|
"<plug>(leap-from-window)",
|
||||||
"leap from window",
|
"leap from window",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -148,21 +151,21 @@ M.leap = {
|
||||||
M.lazygit = {
|
M.lazygit = {
|
||||||
plugin = true,
|
plugin = true,
|
||||||
n = {
|
n = {
|
||||||
["<LEADER>gg"] = { "<CMD> LazyGit <CR>", "Open LazyGit" },
|
["<leader>gg"] = { "<cmd> LazyGit <cr>", "Open LazyGit" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
M.lspconfig = {
|
M.lspconfig = {
|
||||||
plugin = true,
|
plugin = true,
|
||||||
n = {
|
n = {
|
||||||
["<LEADER>ck"] = {
|
["[d"] = {
|
||||||
function()
|
function()
|
||||||
vim.diagnostic.goto_prev { float = { border = "rounded" } }
|
vim.diagnostic.goto_prev { float = { border = "rounded" } }
|
||||||
end,
|
end,
|
||||||
"Goto prev",
|
"Goto prev",
|
||||||
},
|
},
|
||||||
|
|
||||||
["<LEADER>cj"] = {
|
["]d"] = {
|
||||||
function()
|
function()
|
||||||
vim.diagnostic.goto_next { float = { border = "rounded" } }
|
vim.diagnostic.goto_next { float = { border = "rounded" } }
|
||||||
end,
|
end,
|
||||||
|
@ -174,14 +177,14 @@ M.lspconfig = {
|
||||||
M.clipboard = {
|
M.clipboard = {
|
||||||
plugin = false,
|
plugin = false,
|
||||||
n = {
|
n = {
|
||||||
["<LEADER>y"] = { '"+y', "yank to system" },
|
["<leader>y"] = { '"+y', "yank to system" },
|
||||||
["<LEADER>Y"] = { '"+Y', "yank to system" },
|
["<leader>Y"] = { '"+Y', "yank to system" },
|
||||||
["<LEADER>yy"] = { '"+y', "yank to system" },
|
["<leader>yy"] = { '"+y', "yank to system" },
|
||||||
},
|
},
|
||||||
v = {
|
v = {
|
||||||
["<LEADER>y"] = { '"+y', "yank to system" },
|
["<leader>y"] = { '"+y', "yank to system" },
|
||||||
["<LEADER>Y"] = { '"+Y', "yank to system" },
|
["<leader>Y"] = { '"+Y', "yank to system" },
|
||||||
["<LEADER>yy"] = { '"+y', "yank to system" },
|
["<leader>yy"] = { '"+y', "yank to system" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,25 +192,25 @@ M.telescope = {
|
||||||
plugin = true,
|
plugin = true,
|
||||||
n = {
|
n = {
|
||||||
-- find
|
-- find
|
||||||
["<LOCALLEADER>ff"] = { "<CMD> Telescope find_files <CR>", "Find files" },
|
["<localleader>ff"] = { "<cmd> Telescope find_files <cr>", "Find files" },
|
||||||
["<LOCALLEADER>fa"] = { "<CMD> Telescope find_files follow=true no_ignore=true hidden=true <CR>", "Find all" },
|
["<localleader>fa"] = { "<cmd> Telescope find_files follow=true no_ignore=true hidden=true <cr>", "Find all" },
|
||||||
["<LOCALLEADER>fw"] = { "<CMD> Telescope live_grep <CR>", "Live grep" },
|
["<localleader>fw"] = { "<cmd> Telescope live_grep <cr>", "Live grep" },
|
||||||
["<LOCALLEADER>fb"] = { "<CMD> Telescope buffers <CR>", "Find buffers" },
|
["<localleader>fb"] = { "<cmd> Telescope buffers <cr>", "Find buffers" },
|
||||||
["<LOCALLEADER>fh"] = { "<CMD> Telescope help_tags <CR>", "Help page" },
|
["<localleader>fh"] = { "<cmd> Telescope help_tags <cr>", "Help page" },
|
||||||
["<LOCALLEADER>fo"] = { "<CMD> Telescope oldfiles <CR>", "Find oldfiles" },
|
["<localleader>fo"] = { "<cmd> Telescope oldfiles <cr>", "Find oldfiles" },
|
||||||
["<LOCALLEADER>fz"] = { "<CMD> Telescope current_buffer_fuzzy_find <CR>", "Find in current buffer" },
|
["<localleader>fz"] = { "<cmd> Telescope current_buffer_fuzzy_find <cr>", "Find in current buffer" },
|
||||||
|
|
||||||
-- git
|
-- git
|
||||||
["<LOCALLEADER>cm"] = { "<CMD> Telescope git_commits <CR>", "Git commits" },
|
["<localleader>cm"] = { "<cmd> Telescope git_commits <cr>", "Git commits" },
|
||||||
["<LOCALLEADER>gt"] = { "<CMD> Telescope git_status <CR>", "Git status" },
|
["<localleader>gt"] = { "<cmd> Telescope git_status <cr>", "Git status" },
|
||||||
|
|
||||||
-- pick a hidden term
|
-- pick a hidden term
|
||||||
["<LOCALLEADER>pt"] = { "<CMD> Telescope terms <CR>", "Pick hidden term" },
|
["<localleader>pt"] = { "<cmd> Telescope terms <cr>", "Pick hidden term" },
|
||||||
|
|
||||||
-- theme switcher
|
-- theme switcher
|
||||||
["<LOCALLEADER>th"] = { "<CMD> Telescope themes <CR>", "Nvchad themes" },
|
["<localleader>th"] = { "<cmd> Telescope themes <cr>", "Nvchad themes" },
|
||||||
|
|
||||||
["<LOCALLEADER>ma"] = { "<CMD> Telescope marks <CR>", "telescope bookmarks" },
|
["<localleader>ma"] = { "<cmd> Telescope marks <cr>", "telescope bookmarks" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,11 +242,11 @@ M.nvimtree = {
|
||||||
plugin = true,
|
plugin = true,
|
||||||
n = {
|
n = {
|
||||||
-- toggle
|
-- toggle
|
||||||
["<C-n>"] = { "<CMD> NvimTreeToggle <CR>", "Toggle nvimtree" },
|
["<C-n>"] = { "<cmd> NvimTreeToggle <cr>", "Toggle nvimtree" },
|
||||||
["<F5>"] = { "<CMD> NvimTreeToggle <CR>", "Toggle nvimtree" },
|
["<F5>"] = { "<cmd> NvimTreeToggle <cr>", "Toggle nvimtree" },
|
||||||
|
|
||||||
-- focus
|
-- focus
|
||||||
["<LOCALLEADER>e"] = { "<CMD> NvimTreeFocus <CR>", "Focus nvimtree" },
|
["<localleader>e"] = { "<cmd> NvimTreeFocus <cr>", "Focus nvimtree" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,14 +258,14 @@ M.movements = {
|
||||||
["<A-j>"] = { "<C-d>", "big step down" },
|
["<A-j>"] = { "<C-d>", "big step down" },
|
||||||
|
|
||||||
-- go to beginning and end
|
-- go to beginning and end
|
||||||
["<C-b>"] = { "<HOME>", "Beginning of line" },
|
["<C-b>"] = { "<home>", "Beginning of line" },
|
||||||
["<C-e>"] = { "<END>", "End of line" },
|
["<C-e>"] = { "<end>", "End of line" },
|
||||||
|
|
||||||
-- navigate within insert mode
|
-- navigate within insert mode
|
||||||
["<C-h>"] = { "<LEFT>", "Move left" },
|
["<C-h>"] = { "<left>", "Move left" },
|
||||||
["<C-l>"] = { "<RIGHT>", "Move right" },
|
["<C-l>"] = { "<right>", "Move right" },
|
||||||
["<C-j>"] = { "<DOWN>", "Move down" },
|
["<C-j>"] = { "<down>", "Move down" },
|
||||||
["<C-k>"] = { "<UP>", "Move up" },
|
["<C-k>"] = { "<up>", "Move up" },
|
||||||
},
|
},
|
||||||
n = {
|
n = {
|
||||||
--big move
|
--big move
|
||||||
|
@ -270,15 +273,15 @@ M.movements = {
|
||||||
["<A-j>"] = { "<C-d>", "big step down" },
|
["<A-j>"] = { "<C-d>", "big step down" },
|
||||||
|
|
||||||
-- go to beginning and end
|
-- go to beginning and end
|
||||||
["H"] = { "<HOME>", "Beginning of line" },
|
["H"] = { "<home>", "Beginning of line" },
|
||||||
["L"] = { "<END>", "End of line" },
|
["L"] = { "<end>", "End of line" },
|
||||||
|
|
||||||
-- go to mark with "#"
|
-- go to mark with "#"
|
||||||
["#"] = { "'", "go to mark" },
|
["#"] = { "'", "go to mark" },
|
||||||
|
|
||||||
-- spell
|
-- spell
|
||||||
["zn"] = { "]s", "go to next spelling mark"},
|
["]s"] = { "]s", "go to next spelling mark"},
|
||||||
["zN"] = { "[s", "go to last spelling mark"},
|
["[s"] = { "[s", "go to last spelling mark"},
|
||||||
},
|
},
|
||||||
v = {
|
v = {
|
||||||
--big move
|
--big move
|
||||||
|
@ -286,8 +289,8 @@ M.movements = {
|
||||||
["<A-j>"] = { "<C-d>", "big step down" },
|
["<A-j>"] = { "<C-d>", "big step down" },
|
||||||
|
|
||||||
-- go to beginning and end
|
-- go to beginning and end
|
||||||
["H"] = { "<HOME>", "Beginning of line" },
|
["H"] = { "<home>", "Beginning of line" },
|
||||||
["L"] = { "<END>", "End of line" },
|
["L"] = { "<end>", "End of line" },
|
||||||
},
|
},
|
||||||
t = {
|
t = {
|
||||||
["<C-w>"] = {
|
["<C-w>"] = {
|
||||||
|
@ -301,24 +304,24 @@ M.edit = {
|
||||||
plugin = false,
|
plugin = false,
|
||||||
n = {
|
n = {
|
||||||
-- easy newline
|
-- easy newline
|
||||||
["OO"] = { "O<ESC>", "insert a line above", opts = { nowait = false } },
|
["OO"] = { "O<esc>", "insert a line above", opts = { nowait = false } },
|
||||||
["oo"] = { "o<ESC>", "insert a line below", opts = { nowait = false } },
|
["oo"] = { "o<esc>", "insert a line below", opts = { nowait = false } },
|
||||||
|
|
||||||
-- split and join lines
|
-- split and join lines
|
||||||
-- "J" for join is defaul
|
-- "J" for join is defaul
|
||||||
["S"] = {
|
["S"] = {
|
||||||
"i<CR><ESC>l",
|
"i<cr><esc>l",
|
||||||
"split line",
|
"split line",
|
||||||
},
|
},
|
||||||
|
|
||||||
-- do something useful with the arrows
|
-- do something useful with the arrows
|
||||||
["<UP>"] = { "<CMD> move-2<CR>", "Move line up", opts = { expr = true } },
|
["<Up>"] = { "<cmd> move-2<cr>", "Move line up", opts = { expr = true } },
|
||||||
["<DOWN>"] = { "<CMD> move+<CR>", "Move line down", opts = { expr = true } },
|
["<Down>"] = { "<cmd> move+<cr>", "Move line down", opts = { expr = true } },
|
||||||
["<LEFT>"] = { "<CMD> << <CR>", "Less indentation", opts = { expr = true } },
|
["<Left>"] = { "<cmd> << <cr>", "Less indentation", opts = { expr = true } },
|
||||||
["<RIGHT>"] = { "<CMD> >> <CR>", "More indentation", opts = { expr = true } },
|
["<Right>"] = { "<cmd> >> <cr>", "More indentation", opts = { expr = true } },
|
||||||
|
|
||||||
-- format with conform
|
-- format with conform
|
||||||
["<LEADER>ff"] = {
|
["<leader>ff"] = {
|
||||||
function()
|
function()
|
||||||
require("conform").format()
|
require("conform").format()
|
||||||
end,
|
end,
|
||||||
|
@ -326,7 +329,7 @@ M.edit = {
|
||||||
},
|
},
|
||||||
--
|
--
|
||||||
-- remove trailing whitespace
|
-- remove trailing whitespace
|
||||||
["<LEADER>fw"] = {
|
["<leader>fw"] = {
|
||||||
function()
|
function()
|
||||||
require("mini.trailspace").trim()
|
require("mini.trailspace").trim()
|
||||||
end,
|
end,
|
||||||
|
@ -334,12 +337,12 @@ M.edit = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
v = {
|
v = {
|
||||||
["<LEFT>"] = { "<gv", "Less indentation" },
|
["<Left>"] = { "<gv", "Less indentation" },
|
||||||
["<RIGHT>"] = { ">gv", "More indentation" },
|
["<Right>"] = { ">gv", "More indentation" },
|
||||||
},
|
},
|
||||||
x = {
|
x = {
|
||||||
["<UP>"] = { "move'<-2<CR>gv=gv", "Move line up", opts = { expr = true } },
|
["<Up>"] = { "move'<-2<cr>gv=gv", "Move line up", opts = { expr = true } },
|
||||||
["<DOWN>"] = { "move'<-2<CR>gv=gv", "Move line down", opts = { expr = true } },
|
["<Down>"] = { "move'<-2<cr>gv=gv", "Move line down", opts = { expr = true } },
|
||||||
},
|
},
|
||||||
t = {
|
t = {
|
||||||
--big move
|
--big move
|
||||||
|
@ -352,7 +355,7 @@ M.ui = {
|
||||||
plugin = false,
|
plugin = false,
|
||||||
n = {
|
n = {
|
||||||
-- toggle wrap
|
-- toggle wrap
|
||||||
["<LEADER>tw"] = {
|
["<leader>tw"] = {
|
||||||
function()
|
function()
|
||||||
vim.opt_local.wrap = not vim.wo.wrap
|
vim.opt_local.wrap = not vim.wo.wrap
|
||||||
vim.opt_local.breakindent = not vim.wo.breakindent
|
vim.opt_local.breakindent = not vim.wo.breakindent
|
||||||
|
@ -367,28 +370,28 @@ M.ui = {
|
||||||
},
|
},
|
||||||
|
|
||||||
-- toggle some features
|
-- toggle some features
|
||||||
["<LEADER>tn"] = { "<CMD>setlocal nonumber!<CR>", "toggle line numbers" },
|
["<leader>tn"] = { "<cmd>setlocal nonumber!<cr>", "toggle line numbers" },
|
||||||
["<LEADER>trn"] = { "<CMD>setlocal nornu!<CR>", "toggle relative line numbers" },
|
["<leader>trn"] = { "<cmd>setlocal nornu!<cr>", "toggle relative line numbers" },
|
||||||
["<LEADER>ts"] = { "<CMD>setlocal spell!<CR>", "toggle spell check" },
|
["<leader>ts"] = { "<cmd>setlocal spell!<cr>", "toggle spell check" },
|
||||||
|
|
||||||
-- open windows
|
-- open windows
|
||||||
['<LEADER>"'] = { "<CMD>vsplit<CR>", "open a new window to the side" },
|
['<leader>"'] = { "<cmd>vsplit<cr>", "open a new window to the side" },
|
||||||
["<LEADER>%"] = { "<CMD>split<CR>", "open a new window on the totop" },
|
["<leader>%"] = { "<cmd>split<cr>", "open a new window on the totop" },
|
||||||
|
|
||||||
-- resize windows
|
-- resize windows
|
||||||
["<C-Up>"] = { "<CMD>resize +1<CR>", "resize window" },
|
["<C-Up>"] = { "<cmd>resize +1<cr>", "resize window" },
|
||||||
["<C-Down>"] = { "<CMD>resize -1<CR>", "resize window" },
|
["<C-Down>"] = { "<cmd>resize -1<cr>", "resize window" },
|
||||||
["<C-Left>"] = { "<CMD>vertical resize +1<CR>", "resize window" },
|
["<C-Left>"] = { "<cmd>vertical resize +1<cr>", "resize window" },
|
||||||
["<C-Right>"] = { "<CMD>vertical resize -1<CR>", "resize window" },
|
["<C-Right>"] = { "<cmd>vertical resize -1<cr>", "resize window" },
|
||||||
|
|
||||||
-- tabs
|
-- tabs
|
||||||
["<LEADER>wtn"] = { "<CMD>tabnew<CR>", "open a new tab" },
|
["<leader>wn"] = { "<cmd>tabnew<cr>", "open a new tab" },
|
||||||
["<LEADER>wtc"] = { "<CMD>tabclose<CR>", "close current tab" },
|
["<leader>wc"] = { "<cmd>tabclose<cr>", "close current tab" },
|
||||||
["<LEADER>wtj"] = { "<CMD>tabnext<CR>", "open a new tab" },
|
["<leader>wk"] = { "<cmd>tabnext<cr>", "go to next tab" },
|
||||||
["<LEADER>wtk"] = { "<CMD>tabprevious<CR>", "open a new tab" },
|
["<leader>wj"] = { "<cmd>tabprevious<cr>", "go to prev tab" },
|
||||||
|
|
||||||
-- folds
|
-- folds
|
||||||
["<S-RETURN>"] = { "zMzv", "focus on this fold" },
|
["<S-Return>"] = { "zMzv", "focus on this fold" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,8 +84,150 @@ local plugins = {
|
||||||
{
|
{
|
||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
keys = { "<leader>", "<localleader>", "<c-r>", "<c-w>", '"', "'", "`", "c", "v", "g" },
|
keys = { "<leader>", "<localleader>", "<c-r>", "<c-w>", '"', "'", "`", "c", "v", "g" },
|
||||||
|
defaults = {
|
||||||
|
mode = { "n", "v" },
|
||||||
|
[";"] = { name = "+telescope" },
|
||||||
|
[";f"] = { name = "+find" },
|
||||||
|
[";d"] = { name = "+lsp/todo" },
|
||||||
|
["g"] = { name = "+goto" },
|
||||||
|
["]"] = { name = "+next" },
|
||||||
|
["["] = { name = "+prev" },
|
||||||
|
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
||||||
|
["<leader>c"] = { name = "+code" },
|
||||||
|
["<leader>g"] = { name = "+git" },
|
||||||
|
["<leader>t"] = { name = "+toggle/tools" },
|
||||||
|
["<leader>w"] = { name = "+window/which" },
|
||||||
|
["<leader>f"] = { name = "+formatting" },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{ "echasnovski/mini.trailspace", lazy = false, event = { "BufReadPost", "BufNewFile" }, opts = {} },
|
{ "echasnovski/mini.trailspace", lazy = false, event = { "BufReadPost", "BufNewFile" }, opts = {} },
|
||||||
|
{
|
||||||
|
"RRethy/vim-illuminate",
|
||||||
|
lazy = false,
|
||||||
|
event = { "BufReadPost", "BufNewFile" },
|
||||||
|
opts = {
|
||||||
|
delay = 200,
|
||||||
|
under_cursor = false,
|
||||||
|
modes_allowlist = { "n", "no", "nt" },
|
||||||
|
filetypes_denylist = {
|
||||||
|
"DiffviewFileHistory",
|
||||||
|
"DiffviewFiles",
|
||||||
|
"SidebarNvim",
|
||||||
|
"fugitive",
|
||||||
|
"git",
|
||||||
|
"minifiles",
|
||||||
|
"neo-tree",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{ "]]", desc = "Next Reference" },
|
||||||
|
{ "[[", desc = "Prev Reference" },
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("illuminate").configure(opts)
|
||||||
|
|
||||||
|
local function map(key, dir, buffer)
|
||||||
|
vim.keymap.set("n", key, function()
|
||||||
|
require("illuminate")["goto_" .. dir .. "_reference"](false)
|
||||||
|
end, {
|
||||||
|
desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference",
|
||||||
|
buffer = buffer,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
map("]]", "next")
|
||||||
|
map("[[", "prev")
|
||||||
|
|
||||||
|
-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
group = vim.api.nvim_create_augroup("plex_illuminate", {}),
|
||||||
|
callback = function()
|
||||||
|
local buffer = vim.api.nvim_get_current_buf()
|
||||||
|
map("]]", "next", buffer)
|
||||||
|
map("[[", "prev", buffer)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folke/todo-comments.nvim",
|
||||||
|
lazy = false,
|
||||||
|
dependencies = "nvim-telescope/telescope.nvim",
|
||||||
|
-- stylua: ignore
|
||||||
|
keys = {
|
||||||
|
{ ']t', function() require('todo-comments').jump_next() end, desc = 'Next todo comment' },
|
||||||
|
{ '[t', function() require('todo-comments').jump_prev() end, desc = 'Previous todo comment' },
|
||||||
|
{ '<LocalLeader>dt', '<cmd>TodoTelescope<CR>', desc = 'todo' },
|
||||||
|
{ '<leader>xt', '<cmd>TodoTrouble<CR>', desc = 'Todo (Trouble)' },
|
||||||
|
{ '<leader>xT', '<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>', desc = 'Todo/Fix/Fixme (Trouble)' },
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
signs = true,
|
||||||
|
keywords = {
|
||||||
|
FIX = {
|
||||||
|
icon = " ", -- icon used for the sign, and in search results
|
||||||
|
color = "error", -- can be a hex color, or a named color (see below)
|
||||||
|
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
|
||||||
|
-- signs = false, -- configure signs for some keywords individually
|
||||||
|
},
|
||||||
|
TODO = { icon = " ", color = "info" },
|
||||||
|
HACK = { icon = " ", color = "warning" },
|
||||||
|
SECURITY = { icon = " ", color = "warning" },
|
||||||
|
WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } },
|
||||||
|
PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
|
||||||
|
NOTE = { icon = " ", color = "hint", alt = { "INFO" } },
|
||||||
|
TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
cmd = { "Trouble", "TroubleToggle" },
|
||||||
|
opts = { use_diagnostic_signs = true },
|
||||||
|
-- stylua: ignore
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
'<leader>e',
|
||||||
|
'<cmd>TroubleToggle document_diagnostics<CR>',
|
||||||
|
noremap = true,
|
||||||
|
desc =
|
||||||
|
'Document Diagnostics'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'<leader>r',
|
||||||
|
'<cmd>TroubleToggle workspace_diagnostics<CR>',
|
||||||
|
noremap = true,
|
||||||
|
desc =
|
||||||
|
'Workspace Diagnostics'
|
||||||
|
},
|
||||||
|
{ '<leader>xx', '<cmd>TroubleToggle document_diagnostics<cr>', desc = 'Document Diagnostics (Trouble)' },
|
||||||
|
{ '<leader>xX', '<cmd>TroubleToggle workspace_diagnostics<cr>', desc = 'Workspace Diagnostics (Trouble)' },
|
||||||
|
{ '<leader>xQ', '<cmd>TroubleToggle quickfix<cr>', desc = 'Quickfix List (Trouble)' },
|
||||||
|
{ '<leader>xL', '<cmd>TroubleToggle loclist<cr>', desc = 'Location List (Trouble)' },
|
||||||
|
{
|
||||||
|
'[q',
|
||||||
|
function()
|
||||||
|
if require('trouble').is_open() then
|
||||||
|
require('trouble').previous({ skip_groups = true, jump = true })
|
||||||
|
else
|
||||||
|
vim.cmd.cprev()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
desc = 'Previous trouble/quickfix item',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
']q',
|
||||||
|
function()
|
||||||
|
if require('trouble').is_open() then
|
||||||
|
require('trouble').next({ skip_groups = true, jump = true })
|
||||||
|
else
|
||||||
|
vim.cmd.cnext()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
desc = 'Next trouble/quickfix item',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
return plugins
|
return plugins
|
||||||
|
|
|
@ -235,3 +235,4 @@ IDEs
|
||||||
hypervisors
|
hypervisors
|
||||||
QEMU
|
QEMU
|
||||||
virt
|
virt
|
||||||
|
filetypes
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue