Add descs to key maps, add neodev.nvim
Also highlight yanked text.
This commit is contained in:
parent
7599c8e94d
commit
b32dfb7415
6
.stylua.toml
Normal file
6
.stylua.toml
Normal file
@ -0,0 +1,6 @@
|
||||
column_width = 160
|
||||
line_endings = "Unix"
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
quote_style = "AutoPreferSingle"
|
||||
no_call_parentheses = true
|
@ -33,6 +33,12 @@ return require('packer').startup(function(use)
|
||||
require('plugins.fidget-nvim')
|
||||
end,
|
||||
}
|
||||
use {
|
||||
"folke/neodev.nvim",
|
||||
config = function()
|
||||
require('plugins.neodev-nvim')
|
||||
end,
|
||||
}
|
||||
use {
|
||||
'hrsh7th/nvim-cmp',
|
||||
requires = {
|
||||
|
@ -2,7 +2,7 @@ local drex = require('drex')
|
||||
local elements = require('drex.elements')
|
||||
|
||||
-- open the home directory
|
||||
vim.keymap.set('n', '~', '<CMD>Drex ~<CR>', {})
|
||||
vim.keymap.set('n', '~', '<CMD>Drex ~<CR>', { desc = "Open home [~] directory in drex" })
|
||||
-- open parent DREX buffer and focus current file
|
||||
vim.keymap.set('n', '-', function()
|
||||
local path = vim.fn.expand('%:p')
|
||||
@ -12,7 +12,7 @@ vim.keymap.set('n', '-', function()
|
||||
drex.open_directory_buffer(vim.fn.fnamemodify(path, ':h'))
|
||||
elements.focus_element(0, path)
|
||||
end
|
||||
end, {})
|
||||
end, { desc = "Open current directory in drex" })
|
||||
|
||||
require('drex.config').configure({
|
||||
hijack_netrw = true,
|
||||
|
@ -1,11 +1,11 @@
|
||||
vim.keymap.set('n', '<leader>gx', [[<Cmd>G<CR>]], { noremap = false, silent = true })
|
||||
vim.keymap.set('n', '<leader>gs', [[<Cmd>Git<CR>]], { noremap = false, silent = true })
|
||||
vim.keymap.set('n', '<leader>gd', [[<Cmd>Gdiff<CR>]], { noremap = false, silent = true })
|
||||
vim.keymap.set('n', '<leader>gc', [[<Cmd>Gcommit<CR>]], { noremap = false, silent = true })
|
||||
vim.keymap.set('n', '<leader>gb', [[<Cmd>Git blame -C<CR>]], { noremap = false, silent = true })
|
||||
vim.keymap.set('n', '<leader>gp', [[<Cmd>Git push<CR>]], { noremap = false, silent = true })
|
||||
vim.keymap.set('n', '<leader>gf', [[<Cmd>Git push --force<CR>]], { noremap = false, silent = true })
|
||||
vim.keymap.set('n', '<leader>gu', [[<Cmd>Git pull<CR>]], { noremap = false, silent = true })
|
||||
vim.keymap.set('n', '<leader>gh', [[<Cmd>Git diff --cached<CR>]], { noremap = false, silent = true })
|
||||
vim.keymap.set('n', '<leader>go', [[<Cmd>GBrowse<CR>]], { noremap = false, silent = true })
|
||||
vim.keymap.set('v', '<leader>go', [[<Cmd>'<,'>GBrowse<CR>]], { noremap = false, silent = true })
|
||||
vim.keymap.set('n', '<leader>gx', [[<Cmd>G<CR>]], { noremap = false, silent = true, desc = "Toggle [G]it status window" })
|
||||
vim.keymap.set('n', '<leader>gs', [[<Cmd>Git<CR>]], { noremap = false, silent = true, desc = "Toggle [G]it [S]tatus window" })
|
||||
vim.keymap.set('n', '<leader>gd', [[<Cmd>Gdiffsplit<CR>]], { noremap = false, silent = true, desc = "[G]it [D]iff current file against index" })
|
||||
vim.keymap.set('n', '<leader>gc', [[<Cmd>Git commit<CR>]], { noremap = false, silent = true, desc = "[G]it [C]ommit" })
|
||||
vim.keymap.set('n', '<leader>gb', [[<Cmd>Git blame -C<CR>]], { noremap = false, silent = true, desc = "[G]it [B]lame" })
|
||||
vim.keymap.set('n', '<leader>gp', [[<Cmd>Git push<CR>]], { noremap = false, silent = true, desc = "[G]it [P]ush" })
|
||||
vim.keymap.set('n', '<leader>gf', [[<Cmd>Git push --force<CR>]], { noremap = false, silent = true, desc = "[G]it [F]orce push" })
|
||||
vim.keymap.set('n', '<leader>gu', [[<Cmd>Git pull<CR>]], { noremap = false, silent = true, desc = "[G]it p[U]ll" })
|
||||
vim.keymap.set('n', '<leader>gh', [[<Cmd>Git diff --cached<CR>]], { noremap = false, silent = true, desc = "[G]it diff current staged changes" })
|
||||
vim.keymap.set('n', '<leader>go', [[<Cmd>GBrowse<CR>]], { noremap = false, silent = true, desc = "[B]rowse [G]it URL for fugitive object under cursor" })
|
||||
vim.keymap.set('v', '<leader>go', [[<Cmd>'<,'>GBrowse<CR>]], { noremap = false, silent = true, desc = "[B]rowse [G]it URL for selected lines" })
|
||||
|
@ -14,28 +14,28 @@ require('gitsigns').setup({
|
||||
if vim.wo.diff then return ']c' end
|
||||
vim.schedule(function() gs.next_hunk() end)
|
||||
return '<Ignore>'
|
||||
end, {expr=true})
|
||||
end, { expr = true, desc = "Jump to next git hunk [C]hange" })
|
||||
|
||||
map('n', '[c', function()
|
||||
if vim.wo.diff then return '[c' end
|
||||
vim.schedule(function() gs.prev_hunk() end)
|
||||
return '<Ignore>'
|
||||
end, {expr=true})
|
||||
end, { expr = true, desc = "Jump to previous git hunk [C]hange" })
|
||||
|
||||
-- Actions
|
||||
map({'n', 'v'}, '<leader>hs', ':Gitsigns stage_hunk<CR>')
|
||||
map({'n', 'v'}, '<leader>hr', ':Gitsigns reset_hunk<CR>')
|
||||
map('n', '<leader>hS', gs.stage_buffer)
|
||||
map('n', '<leader>hu', gs.undo_stage_hunk)
|
||||
map('n', '<leader>hR', gs.reset_buffer)
|
||||
map('n', '<leader>hp', gs.preview_hunk)
|
||||
map('n', '<leader>hb', function() gs.blame_line{full=true} end)
|
||||
map('n', '<leader>tb', gs.toggle_current_line_blame)
|
||||
map('n', '<leader>hd', gs.diffthis)
|
||||
map('n', '<leader>hD', function() gs.diffthis('~') end)
|
||||
map('n', '<leader>td', gs.toggle_deleted)
|
||||
map({ 'n', 'v' }, '<leader>hs', ':Gitsigns stage_hunk<CR>', { desc = "[S]tage git [H]unk" })
|
||||
map({ 'n', 'v' }, '<leader>hr', ':Gitsigns reset_hunk<CR>', { desc = "[R]eset git [H]unk" })
|
||||
map('n', '<leader>hS', gs.stage_buffer, { desc = "[S]tage git buffer" })
|
||||
map('n', '<leader>hu', gs.undo_stage_hunk, { desc = "[U]ndo git [H]unk" })
|
||||
map('n', '<leader>hR', gs.reset_buffer, { desc = "[R]eset git buffer" })
|
||||
map('n', '<leader>hp', gs.preview_hunk, { desc = "[P]review git [H]unk" })
|
||||
map('n', '<leader>hb', function() gs.blame_line { full = true } end, { desc = "Git [B]lame line" })
|
||||
map('n', '<leader>tb', gs.toggle_current_line_blame, { desc = "[T]oggle current line git [B]lame" })
|
||||
map('n', '<leader>hd', gs.diffthis, { desc = "Git [D]iff current file with index" })
|
||||
map('n', '<leader>hD', function() gs.diffthis('~') end, { desc = "Git [D]iff current file with last commit" })
|
||||
map('n', '<leader>td', gs.toggle_deleted, { desc = "[T]oggle showing [D]eleted git hunks" })
|
||||
|
||||
-- Text object
|
||||
map({'o', 'x'}, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
|
||||
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', { desc = "Select git [H]unk under cursor" })
|
||||
end
|
||||
})
|
||||
|
@ -3,6 +3,6 @@ require('gui-font-resize').setup({
|
||||
change_by = 1, -- step value that will inc/dec the fontsize by
|
||||
})
|
||||
|
||||
vim.keymap.set('n', '<D-Up>', [[<Cmd>GUIFontSizeUp<CR>]], { noremap = true, silent = true})
|
||||
vim.keymap.set('n', '<D-Down>', [[<Cmd>GUIFontSizeDown<CR>]], { noremap = true, silent = true})
|
||||
vim.keymap.set('n', '<D-0>', [[<Cmd>set guifont=Hack:h11 | GUIFontSizeSet<CR>]], { noremap = true, silent = true})
|
||||
vim.keymap.set('n', '<D-Up>', [[<Cmd>GUIFontSizeUp<CR>]], { noremap = true, silent = true, desc = "Increase font size" })
|
||||
vim.keymap.set('n', '<D-Down>', [[<Cmd>GUIFontSizeDown<CR>]], { noremap = true, silent = true, desc = "Decrease font size" })
|
||||
vim.keymap.set('n', '<D-0>', [[<Cmd>set guifont=Hack:h11 | GUIFontSizeSet<CR>]], { noremap = true, silent = true, desc = "Set font family and size to default" })
|
||||
|
@ -50,6 +50,9 @@ require('lspconfig')['sumneko_lua'].setup({
|
||||
flags = lsp_flags,
|
||||
settings = {
|
||||
Lua = {
|
||||
completion = {
|
||||
callSnippet = "Replace"
|
||||
},
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
|
1
lua/plugins/neodev-nvim.lua
Normal file
1
lua/plugins/neodev-nvim.lua
Normal file
@ -0,0 +1 @@
|
||||
require('neodev').setup({})
|
@ -5,12 +5,12 @@ neotest.setup({
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>t", function() neotest.run.run() end)
|
||||
vim.keymap.set("n", "<leader>tf", function() neotest.run.run(vim.fn.expand('%')) end)
|
||||
vim.keymap.set("n", "<leader>tt", function() neotest.run.run({ strategy = 'dap' }) end)
|
||||
vim.keymap.set("n", "<leader>ta", function() neotest.run.attach() end)
|
||||
vim.keymap.set("n", "<leader>to", function() neotest.output.open({ enter = true }) end)
|
||||
vim.keymap.set("n", "<leader>ts", function() neotest.summary.toggle() end)
|
||||
vim.keymap.set("n", "<leader>t", function() neotest.run.run() end, { desc = "Run neo[T]ests under cursor"})
|
||||
vim.keymap.set("n", "<leader>tf", function() neotest.run.run(vim.fn.expand('%')) end, { desc = "Run neo[T]ests in current file" })
|
||||
vim.keymap.set("n", "<leader>tt", function() neotest.run.run({ strategy = 'dap' }) end, { desc = "Run neo[T]ests in DAP debugging mode" })
|
||||
vim.keymap.set("n", "<leader>ta", function() neotest.run.attach() end, { desc = "[A]ttach to neo[T]est process" })
|
||||
vim.keymap.set("n", "<leader>to", function() neotest.output.open({ enter = true }) end, { desc = "[O]pen neo[T]ests summary window" })
|
||||
vim.keymap.set("n", "<leader>ts", function() neotest.summary.toggle() end, { desc = "Toggle neo[T]est [S]ummary window"})
|
||||
|
||||
vim.diagnostic.config({
|
||||
neotest = true,
|
||||
|
@ -21,7 +21,7 @@ local dap = require('dap')
|
||||
-- },
|
||||
-- }
|
||||
|
||||
vim.keymap.set('n', '<leader>b', [[<Cmd>lua require('dap').toggle_breakpoint()<CR>]])
|
||||
vim.keymap.set('n', '<leader>be', [[<Cmd>lua require('dap').set_exception_breakpoints()<CR>]])
|
||||
vim.keymap.set('n', '<leader>bc', [[<Cmd>lua require('dap').clear_breakpoints()<CR>]])
|
||||
vim.keymap.set('n', '<leader>bo', [[<Cmd>lua require('dapui').toggle()<CR>]])
|
||||
vim.keymap.set('n', '<leader>b', [[<Cmd>lua require('dap').toggle_breakpoint()<CR>]], { desc = "Toggle DAP [B]reakpoint"})
|
||||
vim.keymap.set('n', '<leader>be', [[<Cmd>lua require('dap').set_exception_breakpoints()<CR>]], { desc = "Toggle DAP [B]reak on [E]xceptions" })
|
||||
vim.keymap.set('n', '<leader>bc', [[<Cmd>lua require('dap').clear_breakpoints()<CR>]], { desc = "[C]lear DAP [B]reakpoints" })
|
||||
vim.keymap.set('n', '<leader>bo', [[<Cmd>lua require('dapui').toggle()<CR>]], { desc = "Toggle nvim dapui" })
|
||||
|
@ -28,4 +28,4 @@ require('nvim-tree').setup({
|
||||
|
||||
-- swapping this out with drex.nvim instead
|
||||
-- vim.keymap.set('n', '-', function() toggle_replace() end, { noremap = true, silent = true })
|
||||
vim.keymap.set('n', '<leader>n', [[<Cmd>NvimTreeToggle<CR>]], { noremap = true, silent = true })
|
||||
vim.keymap.set('n', '<leader>n', [[<Cmd>NvimTreeToggle<CR>]], { noremap = true, silent = true, desc = "Toggle [N]vim Tree" })
|
||||
|
@ -11,10 +11,10 @@ require('nvim-treesitter.configs').setup {
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "gnn",
|
||||
node_incremental = "grn",
|
||||
scope_incremental = "grc",
|
||||
node_decremental = "grm",
|
||||
init_selection = "<c-space>",
|
||||
node_incremental = "<c-space>",
|
||||
scope_incremental = "<c-s>",
|
||||
node_decremental = "<c-backspace>",
|
||||
},
|
||||
},
|
||||
indent = {
|
||||
@ -23,8 +23,11 @@ require('nvim-treesitter.configs').setup {
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
['aa'] = '@parameter.outer',
|
||||
['ia'] = '@parameter.inner',
|
||||
['af'] = '@function.outer',
|
||||
['if'] = '@function.inner',
|
||||
['ac'] = '@class.outer',
|
||||
@ -32,6 +35,35 @@ require('nvim-treesitter.configs').setup {
|
||||
}
|
||||
}
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
goto_next_start = {
|
||||
[']m'] = '@function.outer',
|
||||
[']]'] = '@class.outer',
|
||||
},
|
||||
goto_next_end = {
|
||||
[']M'] = '@function.outer',
|
||||
[']['] = '@class.outer',
|
||||
},
|
||||
goto_previous_start = {
|
||||
['[m'] = '@function.outer',
|
||||
['[['] = '@class.outer',
|
||||
},
|
||||
goto_previous_end = {
|
||||
['[M'] = '@function.outer',
|
||||
['[]'] = '@class.outer',
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
['<leader>a'] = '@parameter.inner',
|
||||
},
|
||||
swap_previous = {
|
||||
['<leader>A'] = '@parameter.inner',
|
||||
},
|
||||
},
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
|
@ -2,6 +2,6 @@ require('rest-nvim').setup({
|
||||
skip_ssl_verification = true,
|
||||
})
|
||||
|
||||
vim.keymap.set('n', '<leader>rd', [[<Plug>RestNvim]], { noremap = false, silent = true })
|
||||
vim.keymap.set('n', '<leader>ry', [[<Plug>RestNvimPreview]], { noremap = false, silent = true })
|
||||
vim.keymap.set('n', '<leader>rd', [[<Plug>RestNvim]], { noremap = false, silent = true, desc = "Run rest.nvim under cursor" })
|
||||
vim.keymap.set('n', '<leader>ry', [[<Plug>RestNvimPreview]], { noremap = false, silent = true, desc = "Show cURL command for rest.nvim under cursor"})
|
||||
vim.keymap.set('n', '<leader>ri', [[<Plug>RestNvimLast]], { noremap = false, silent = true })
|
||||
|
@ -16,12 +16,12 @@ rt.setup({
|
||||
capabilities = nvim_cmp_capabilities,
|
||||
on_attach = function(client, bufnr)
|
||||
lsp_on_attach(client, bufnr)
|
||||
vim.keymap.set('n', '<C-space>', rt.hover_actions.hover_actions, { buffer = bufnr })
|
||||
vim.keymap.set('n', '<C-space>', rt.hover_actions.hover_actions, { buffer = bufnr, desc = "Show hover actions under cursor" })
|
||||
-- Code action groups
|
||||
vim.keymap.set('n', '<Leader>a', rt.code_action_group.code_action_group, { buffer = bufnr })
|
||||
vim.keymap.set('n', '<leader>rc', rt.open_cargo_toml.open_cargo_toml, { buffer = bufnr })
|
||||
vim.keymap.set('n', '<leader>rp', rt.parent_module.parent_module, { buffer = bufnr })
|
||||
vim.keymap.set('n', '<leader>rm', rt.expand_macro.expand_macro, { buffer = bufnr })
|
||||
vim.keymap.set('n', '<leader>a', rt.code_action_group.code_action_group, { buffer = bufnr, desc = "Show code actions under cursor" })
|
||||
vim.keymap.set('n', '<leader>rc', rt.open_cargo_toml.open_cargo_toml, { buffer = bufnr, desc = "Open Cargo.toml for current project" })
|
||||
vim.keymap.set('n', '<leader>rp', rt.parent_module.parent_module, { buffer = bufnr, desc = "Go to parent Rust module" })
|
||||
vim.keymap.set('n', '<leader>rm', rt.expand_macro.expand_macro, { buffer = bufnr, desc = "Expand Rust macro" })
|
||||
end,
|
||||
settings = {
|
||||
-- to enable rust-analyzer settings visit:
|
||||
|
@ -33,131 +33,131 @@ vim.keymap.set(
|
||||
'n',
|
||||
'<leader><tab>',
|
||||
[[<Cmd>lua require('telescope.builtin').git_files({ show_untracked = true })<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "Find git files" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>f.',
|
||||
[[<Cmd>lua require('telescope.builtin').git_files({ no_ignore = true })<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "[F]ind ALL git files including ignored [.]" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'_',
|
||||
[[<Cmd>lua require('telescope.builtin').live_grep()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "Search by live grep" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>_',
|
||||
[[<Cmd>lua require('telescope.builtin').live_grep({ search_dirs = { vim.fn.expand('%:p:h') } })<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "Search by live grep in current (present) working directory" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>8',
|
||||
[[<Cmd>lua require('telescope.builtin').grep_string()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "Search by grep" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>3',
|
||||
[[<Cmd>lua require('telescope.builtin').grep_string()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "Search by grep" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>fd",
|
||||
[[<Cmd>lua require('telescope.builtin').find_files({cwd=require('telescope.utils').buffer_dir()})<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "[F]ind [D]irectories" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>fb',
|
||||
[[<Cmd>lua require('telescope.builtin').buffers()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "[F]ind [B]uffers" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>fh',
|
||||
[[<Cmd>lua require('telescope.builtin').help_tags()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "[F]ind [T]ags" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>ft',
|
||||
[[<Cmd>lua require('telescope.builtin').treesitter()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "[F]ind [T]reesitter objects" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>fr',
|
||||
[[<Cmd>lua require('telescope.builtin').resume()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "[R]esume last [F]ind" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>fs',
|
||||
[[<Cmd>lua require('telescope.builtin').spell_suggest()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "[F]ind [S]pelling suggestion" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<Leader>fgc',
|
||||
[[<Cmd>lua require('telescope.builtin').git_commits()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "[F]ind [G]it [C]ommits" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
'<Leader>fga',
|
||||
[[<Cmd>lua require('telescope.builtin').git_bcommits()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "[F]ind [G]it commits for current buffer" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<Leader>fgb',
|
||||
[[<Cmd>lua require('telescope.builtin').git_branches()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "[F]ind [G]it [B]ranches" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<Leader>fe',
|
||||
[[<Cmd>Telescope emoji<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "[F]ind [E]moji" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<Leader>f"',
|
||||
[[<Cmd>lua require('telescope.builtin').registers()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "[F]ind registers [\"]" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<Leader>fm',
|
||||
[[<Cmd>lua require('telescope.builtin').keymaps()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "[F]ind key [M]appings" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<Leader>ff',
|
||||
[[<Cmd>lua require('telescope.builtin').builtin()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "[F]ind telescope [F]inders" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<Leader>fl',
|
||||
[[<Cmd>lua require('telescope.builtin').reloader()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "[F]ind [L]ua module to reload" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<C-p>',
|
||||
[[<Cmd>lua require('telescope').extensions.project.project({ display_type = 'full' })<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "Find projects" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>`',
|
||||
[[<Cmd>lua require('session-lens').search_session()<CR>]],
|
||||
{ noremap = true, silent = true }
|
||||
{ noremap = true, silent = true, desc = "Find sessions" }
|
||||
)
|
||||
|
@ -5,17 +5,17 @@ require("toggleterm").setup({
|
||||
-- shell = 'fish',
|
||||
})
|
||||
|
||||
vim.keymap.set('n', [[<M-=>]], [[<Cmd>ToggleTerm direction=float<CR>]])
|
||||
vim.keymap.set('n', [[<M-\>]], [[<Cmd>ToggleTerm direction=horizontal<CR>]])
|
||||
vim.keymap.set('n', [[<M-=>]], [[<Cmd>ToggleTerm direction=float<CR>]], { desc = "Toggle terminal in floating window" })
|
||||
vim.keymap.set('n', [[<M-\>]], [[<Cmd>ToggleTerm direction=horizontal<CR>]], { desc = "Toggle terminal in horizontal bottom window" })
|
||||
-- tmux muscle-memory for fullscreening nvim window
|
||||
-- replaced with true-zen.nvim
|
||||
-- vim.keymap.set('n', [[<C-a>z]], [[<Cmd>ToggleTermToggleAll<CR>]])
|
||||
-- vim.keymap.set('t', [[<C-a>z]], [[<Cmd>tab split<CR>]])
|
||||
vim.keymap.set('t', '<Esc>', [[<C-\><C-n>]])
|
||||
vim.keymap.set('t', '<C-j>', [[<Cmd>wincmd h<CR>]])
|
||||
vim.keymap.set('t', '<C-k>', [[<Cmd>wincmd k<CR>]])
|
||||
vim.keymap.set('t', '<C-h>', [[<Cmd>wincmd h<CR>]])
|
||||
vim.keymap.set('t', '<C-l>', [[<Cmd>wincmd l<CR>]])
|
||||
vim.keymap.set('t', '<Esc>', [[<C-\><C-n>]], { desc = "Escape terminal mode" })
|
||||
vim.keymap.set('t', '<C-j>', [[<Cmd>wincmd h<CR>]], { desc = "Move focus down one window" })
|
||||
vim.keymap.set('t', '<C-k>', [[<Cmd>wincmd k<CR>]], { desc = "Move focus up one window" })
|
||||
vim.keymap.set('t', '<C-h>', [[<Cmd>wincmd h<CR>]], { desc = "Move focus left one window" })
|
||||
vim.keymap.set('t', '<C-l>', [[<Cmd>wincmd l<CR>]], { desc = "Move focus right one window" })
|
||||
|
||||
-- vim.keymap.set('n', '<F12>', [[<Cmd>ToggleTerm<CR>]], { noremap = true, silent = true })
|
||||
-- vim.keymap.set('t', '<F12>', [[<Cmd>ToggleTerm<CR>]], { noremap = true, silent = true })
|
||||
@ -38,7 +38,7 @@ function _gitui_toggle()
|
||||
gitui:toggle()
|
||||
end
|
||||
|
||||
vim.keymap.set('n', '<leader>G', '<cmd>lua _gitui_toggle()<CR>', { noremap = true, silent = true })
|
||||
vim.keymap.set('n', '<leader>G', '<cmd>lua _gitui_toggle()<CR>', { noremap = true, silent = true, desc = "Toggle gitui floating terminal" })
|
||||
|
||||
-- Custom clx commandline hacker news terminal
|
||||
local clx = Terminal:new({
|
||||
@ -57,4 +57,4 @@ function _clx_toggle()
|
||||
clx:toggle()
|
||||
end
|
||||
|
||||
vim.keymap.set('n', '<leader>H', '<cmd>lua _clx_toggle()<CR>', { noremap = true, silent = true })
|
||||
vim.keymap.set('n', '<leader>H', '<cmd>lua _clx_toggle()<CR>', { noremap = true, silent = true, desc = "Toggle clx (console HackerNews) floating terminal" })
|
||||
|
@ -1,18 +1,18 @@
|
||||
vim.keymap.set('n', '<leader>xx', '<cmd>TroubleToggle<cr>',
|
||||
{ silent = true, noremap = true }
|
||||
{ silent = true, noremap = true, desc = "Toggle trouble buffer diagnostics" }
|
||||
)
|
||||
vim.keymap.set('n', '<leader>xw', '<cmd>TroubleToggle workspace_diagnostics<cr>',
|
||||
{ silent = true, noremap = true }
|
||||
{ silent = true, noremap = true, desc = "Toggle trouble workspace diagnostics" }
|
||||
)
|
||||
vim.keymap.set('n', '<leader>xd', '<cmd>TroubleToggle document_diagnostics<cr>',
|
||||
{ silent = true, noremap = true }
|
||||
{ silent = true, noremap = true, desc = "Toggle trouble document diagnostics" }
|
||||
)
|
||||
vim.keymap.set('n', '<leader>xl', '<cmd>TroubleToggle loclist<cr>',
|
||||
{ silent = true, noremap = true }
|
||||
{ silent = true, noremap = true, desc = "Toggle trouble diagnostics in loclist" }
|
||||
)
|
||||
vim.keymap.set('n', '<leader>xq', '<cmd>TroubleToggle quickfix<cr>',
|
||||
{ silent = true, noremap = true }
|
||||
{ silent = true, noremap = true, desc = "Toggle trouble diagnostics in quickfix" }
|
||||
)
|
||||
vim.keymap.set('n', 'gR', '<cmd>TroubleToggle lsp_references<cr>',
|
||||
{ silent = true, noremap = true }
|
||||
{ silent = true, noremap = true, desc = "Toggle trouble LSP [R]eferences under cursor" }
|
||||
)
|
||||
|
@ -1,10 +1,10 @@
|
||||
require('true-zen').setup()
|
||||
|
||||
vim.keymap.set('n', '<leader>zn', [[<Cmd>:TZNarrow<CR>]], { noremap = true, silent = true })
|
||||
vim.keymap.set('v', '<leader>zn', [[<Cmd>:'<,'>TZNarrow<CR>]], { noremap = true, silent = true })
|
||||
vim.keymap.set('n', '<leader>zf', [[<Cmd>:TZFocus<CR>]], { noremap = true, silent = true })
|
||||
vim.keymap.set('n', '<leader>zm', [[<Cmd>:TZMinimalist<CR>]], { noremap = true, silent = true })
|
||||
vim.keymap.set('n', '<leader>za', [[<Cmd>:TZAtaraxis<CR>]], { noremap = true, silent = true })
|
||||
vim.keymap.set('n', '<leader>zn', [[<Cmd>:TZNarrow<CR>]], { noremap = true, silent = true, desc = "[Z]oom [N]arrow current line" })
|
||||
vim.keymap.set('v', '<leader>zn', [[<Cmd>:'<,'>TZNarrow<CR>]], { noremap = true, silent = true, desc = "[Z]oom [N]arrow selected lines" })
|
||||
vim.keymap.set('n', '<leader>zf', [[<Cmd>:TZFocus<CR>]], { noremap = true, silent = true, desc = "[Z]oom [N]arrow current buffer in new tab" })
|
||||
vim.keymap.set('n', '<leader>zm', [[<Cmd>:TZMinimalist<CR>]], { noremap = true, silent = true, desc = "[Z] Toggle minimalist nvim UI mode" })
|
||||
vim.keymap.set('n', '<leader>za', [[<Cmd>:TZAtaraxis<CR>]], { noremap = true, silent = true, desc = "[Z]oom [A]taraxis current buffer minimalist mode" })
|
||||
-- tmux muscle-memory for fullscreening nvim window
|
||||
vim.keymap.set('n', [[<C-a>z]], [[<Cmd>:TZFocus<CR>]])
|
||||
vim.keymap.set('t', [[<C-a>z]], [[<Cmd>:TZFocus<CR>]])
|
||||
vim.keymap.set('n', [[<C-a>z]], [[<Cmd>:TZFocus<CR>]], { desc = "Toggle [Z]oom current buffer in new tab" })
|
||||
vim.keymap.set('t', [[<C-a>z]], [[<Cmd>:TZFocus<CR>]], { desc = "Toggle [Z]oom current terminal buffer in new tab" })
|
||||
|
@ -1 +1 @@
|
||||
vim.keymap.set('n', '<leader>u', [[<Cmd>MundoToggle<CR>]], { noremap = true, silent = true })
|
||||
vim.keymap.set('n', '<leader>u', [[<Cmd>MundoToggle<CR>]], { noremap = true, silent = true, desc = "Toggle [U]ndo UI"})
|
||||
|
@ -12,9 +12,9 @@ vim.keymap.set('n', '<C-k>', '<C-w>k')
|
||||
vim.keymap.set('n', '<C-h>', '<C-w>h')
|
||||
vim.keymap.set('n', '<C-l>', '<C-w>l')
|
||||
|
||||
vim.keymap.set('n', '<leader>,', ':noh<CR>', { silent = true })
|
||||
vim.keymap.set('n', '<leader>,', ':noh<CR>', { silent = true, desc = "Clear highlighting" })
|
||||
|
||||
vim.keymap.set('n', '<leader>v', [[<Cmd>:e ~/.config/nvim/init.lua<CR>]], { silent = true })
|
||||
vim.keymap.set('n', '<leader>v', [[<Cmd>:e ~/.config/nvim/init.lua<CR>]], { silent = true, desc = "Open [V]im config" })
|
||||
|
||||
-- URL handling (since I disabled netrw)
|
||||
-- source: https://sbulav.github.io/vim/neovim-opening-urls/
|
||||
|
@ -78,3 +78,14 @@ vim.g.neovide_cursor_animation_length = 0.06
|
||||
vim.g.neovide_cursor_trail_size = 0.2 -- default: 0.8
|
||||
|
||||
vim.api.nvim_set_hl(0, 'OctoEditable', { bg = '#313131' })
|
||||
|
||||
-- [[ Highlight on yank ]]
|
||||
-- See `:help vim.highlight.on_yank()`
|
||||
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
group = highlight_group,
|
||||
pattern = '*',
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user