mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 16:41:43 +05:30
NVim
- Shell script formatting: shellharden made 2nd choice and NOT 2nd formatter - Keymaps organized: more accessible, more consistent TODO - Ideavimrc fix backspace issue - Make the keymaps in sync with NVim
This commit is contained in:
@@ -4,6 +4,25 @@
|
|||||||
" Enable IdeaVim plugins https://jb.gg/ideavim-plugins
|
" Enable IdeaVim plugins https://jb.gg/ideavim-plugins
|
||||||
|
|
||||||
"source ~/.vimrc
|
"source ~/.vimrc
|
||||||
|
" FIX: "u" appears randomly when deleting words and other times
|
||||||
|
" TODO: Keep the mappings same across Neovim & Idea
|
||||||
|
" Keymap structure:
|
||||||
|
" b+: [B]buffer Operations
|
||||||
|
" c+: [C]oding Stuff
|
||||||
|
" d+: [D]iagnostics
|
||||||
|
" f+: [F]ile Operations
|
||||||
|
" g+: [G]it Operations
|
||||||
|
" l+: [L]ist Things
|
||||||
|
" n+: [N]eoVim Stuff
|
||||||
|
" s+: Grep/[S]earch Things
|
||||||
|
" t+: [T]est runner stuff
|
||||||
|
" x+: close/dismiss something
|
||||||
|
" e: explorer
|
||||||
|
" j: EasyMotion jump
|
||||||
|
" p: Paste from system clipboard
|
||||||
|
" y: Copy selected stuff to system clipboard
|
||||||
|
" u: Open undo-tree side-panel
|
||||||
|
" v: Open document symbol explorer
|
||||||
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
source ~/.vim/configs.vim
|
source ~/.vim/configs.vim
|
||||||
@@ -19,11 +38,7 @@ set tabstop=4
|
|||||||
set shiftwidth=4
|
set shiftwidth=4
|
||||||
|
|
||||||
" Searches
|
" Searches
|
||||||
set hlsearch " highlight search occurrences
|
set hlsearch ignorecase smartcase incsearch wrapscan
|
||||||
set ignorecase " ignore case in search patterns
|
|
||||||
set smartcase " no ignore case when pattern is uppercase
|
|
||||||
set incsearch " show search results while typing
|
|
||||||
set wrapscan " searches wrap around the end of the file
|
|
||||||
|
|
||||||
" Common settings
|
" Common settings
|
||||||
set gdefault " substitute all occurrences in line
|
set gdefault " substitute all occurrences in line
|
||||||
|
|||||||
@@ -7,20 +7,25 @@
|
|||||||
-- Check past messages -> :messages
|
-- Check past messages -> :messages
|
||||||
|
|
||||||
-- TIP: Keymap structure:
|
-- TIP: Keymap structure:
|
||||||
-- b: buffer
|
-- b+: [B]buffer Operations
|
||||||
-- g: git/github
|
-- c+: [C]oding Stuff
|
||||||
-- c: Coding Stuff
|
-- d+: [D]iagnostics
|
||||||
|
-- f+: [F]ile Operations
|
||||||
|
-- g+: [G]it Operations
|
||||||
|
-- l+: [L]ist Things
|
||||||
|
-- n+: [N]eoVim Stuff
|
||||||
|
-- s+: Grep/[S]earch Things
|
||||||
|
-- t+: [T]est runner stuff
|
||||||
|
-- x+: close/dismiss something
|
||||||
-- e: explorer
|
-- e: explorer
|
||||||
-- l: list & find something
|
-- j: EasyMotion jump
|
||||||
-- s: Grep/Search over something
|
-- p: Paste from system clipboard
|
||||||
-- x: close/dismiss something
|
-- y: Copy selected stuff to system clipboard
|
||||||
-- l: List some stuff
|
-- u: Open undo-tree side-panel
|
||||||
-- d: [D]iagnostics
|
-- v: Open document symbol explorer
|
||||||
-- t: Test runner stuff
|
|
||||||
|
|
||||||
-- TODO:
|
-- TODO:
|
||||||
-- Reduce noice timeout
|
-- Reduce noice timeout
|
||||||
-- WhichKey add hints
|
|
||||||
|
|
||||||
-- Load keymaps & options
|
-- Load keymaps & options
|
||||||
require("config")
|
require("config")
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ return {
|
|||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set("n", "<F5>", dap.continue, { desc = "Debug: Start/Continue" })
|
vim.keymap.set("n", "<F5>", dap.continue, { desc = "Debug: Start/Continue" })
|
||||||
vim.keymap.set("n", "<F1>", dap.step_into, { desc = "Debug: Step Into" })
|
vim.keymap.set("n", "<F11>", dap.step_into, { desc = "Debug: Step Into" })
|
||||||
vim.keymap.set("n", "<F2>", dap.step_over, { desc = "Debug: Step Over" })
|
vim.keymap.set("n", "<S-F11>", dap.step_over, { desc = "Debug: Step Over" })
|
||||||
vim.keymap.set("n", "<F3>", dap.step_out, { desc = "Debug: Step Out" })
|
vim.keymap.set("n", "<F12>", dap.step_out, { desc = "Debug: Step Out" })
|
||||||
vim.keymap.set("n", "<leader>b", dap.toggle_breakpoint, { desc = "Debug: Toggle Breakpoint" })
|
vim.keymap.set("n", "<F9>", dap.toggle_breakpoint, { desc = "Debug: Toggle Breakpoint" })
|
||||||
vim.keymap.set("n", "<leader>B", function()
|
vim.keymap.set("n", "<S-F9>", function()
|
||||||
dap.set_breakpoint(vim.fn.input("Breakpoint condition: "))
|
dap.set_breakpoint(vim.fn.input("Breakpoint condition: "))
|
||||||
end, { desc = "Debug: Set Breakpoint" })
|
end, { desc = "Debug: Set Breakpoint" })
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ return {
|
|||||||
graphql = { { "prettierd", "prettier" } },
|
graphql = { { "prettierd", "prettier" } },
|
||||||
lua = { "stylua" },
|
lua = { "stylua" },
|
||||||
python = { "black" },
|
python = { "black" },
|
||||||
sh = { "shfmt", "shellharden" },
|
sh = { { "shfmt", "shellharden" } },
|
||||||
bash = { "shfmt", "shellharden" },
|
bash = { { "shfmt", "shellharden" } },
|
||||||
zsh = { "shfmt", "shellharden" },
|
zsh = { { "shfmt", "shellharden" } },
|
||||||
["*"] = { "codespell" },
|
["*"] = { "codespell" },
|
||||||
["_"] = { "trim_whitespace" },
|
["_"] = { "trim_whitespace" },
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,11 +11,12 @@ return {
|
|||||||
signs = {
|
signs = {
|
||||||
add = { text = "+" },
|
add = { text = "+" },
|
||||||
change = { text = "~" },
|
change = { text = "~" },
|
||||||
delete = { text = "_" },
|
delete = { text = "—" },
|
||||||
topdelete = { text = "‾" },
|
topdelete = { text = "—" },
|
||||||
changedelete = { text = "~" },
|
changedelete = { text = "~" },
|
||||||
untracked = { text = "▎" },
|
untracked = { text = "┆" },
|
||||||
},
|
},
|
||||||
|
attach_to_untracker = true,
|
||||||
on_attach = function(bufnr)
|
on_attach = function(bufnr)
|
||||||
local gs = package.loaded.gitsigns
|
local gs = package.loaded.gitsigns
|
||||||
|
|
||||||
@@ -46,30 +47,34 @@ return {
|
|||||||
return "<Ignore>"
|
return "<Ignore>"
|
||||||
end, { expr = true, desc = "Jump to previous git hunk" })
|
end, { expr = true, desc = "Jump to previous git hunk" })
|
||||||
|
|
||||||
|
-- Staging
|
||||||
-- Actions
|
-- Actions
|
||||||
-- visual mode
|
map("n", "<leader>gsh", gs.stage_hunk, { desc = "Git: Stage Hunk" })
|
||||||
map("v", "<leader>ghr", function()
|
map("n", "<leader>gsu", gs.undo_stage_hunk, { desc = "Git: Undo Stage Hunk" })
|
||||||
gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
map("n", "<leader>gsb", gs.stage_buffer, { desc = "Git: Stage Current File" })
|
||||||
end, { desc = "reset git hunk" })
|
map("n", "<leader>gr", gs.reset_hunk, { desc = "Git: reset hunk" })
|
||||||
-- normal mode
|
|
||||||
map("n", "<leader>ghp", gs.preview_hunk, { desc = "preview git hunk" })
|
|
||||||
map("n", "<leader>gp", gs.preview_hunk, { desc = "preview git hunk" })
|
|
||||||
|
|
||||||
map("n", "<leader>ghr", gs.reset_hunk, { desc = "git reset hunk" })
|
-- visual mode
|
||||||
map("n", "<leader>ghb", function()
|
map("v", "<leader>gsH", function()
|
||||||
gs.blame_line({ full = false })
|
gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||||
end, { desc = "git blame line" })
|
end, { desc = "Git: Visual Stage Hunk" })
|
||||||
map("n", "<leader>ghD", gs.diffthis, { desc = "git diff against index" })
|
map("v", "<leader>gsR", function()
|
||||||
map("n", "<leader>ghd", function()
|
gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||||
|
end, { desc = "Git: Visual Reset Hunk" })
|
||||||
|
|
||||||
|
-- normal mode
|
||||||
|
map("n", "<leader>gp", gs.preview_hunk, { desc = "Git: Preview hunk" })
|
||||||
|
map("n", "<leader>gD", gs.diffthis, { desc = "Git: diff against index" })
|
||||||
|
map("n", "<leader>gd", function()
|
||||||
gs.diffthis("~")
|
gs.diffthis("~")
|
||||||
end, { desc = "git diff against last commit" })
|
end, { desc = "Git: diff against last commit" })
|
||||||
|
|
||||||
-- Toggles
|
-- Toggles
|
||||||
map("n", "<leader>gtb", gs.toggle_current_line_blame, { desc = "toggle git blame line" })
|
map("n", "<leader>gtb", gs.toggle_current_line_blame, { desc = "Git: toggle blame line" })
|
||||||
map("n", "<leader>gtd", gs.toggle_deleted, { desc = "toggle git show deleted" })
|
map("n", "<leader>gtd", gs.toggle_deleted, { desc = "Git: toggle show deleted" })
|
||||||
|
|
||||||
-- Text object
|
-- Text object
|
||||||
map({ "o", "x" }, "gih", ":<C-U>Gitsigns select_hunk<CR>", { desc = "select git hunk" })
|
map({ "o", "x" }, "gih", ":<C-U>Gitsigns select_hunk<CR>", { desc = "Git: Visual select hunk" })
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -8,46 +8,10 @@ return {
|
|||||||
|
|
||||||
-- Linters are only required for dynamically typed languages
|
-- Linters are only required for dynamically typed languages
|
||||||
lint.linters_by_ft = {
|
lint.linters_by_ft = {
|
||||||
-- javascript = { "eslint_d" },
|
|
||||||
-- typescript = { "eslint_d" },
|
|
||||||
-- javascriptreact = { "eslint_d" },
|
|
||||||
-- typescriptreact = { "eslint_d" },
|
|
||||||
svelte = { "eslint_d" },
|
|
||||||
python = { "pylint" },
|
python = { "pylint" },
|
||||||
["*"] = { "codespell" },
|
["*"] = { "codespell" },
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Uncomment and use the below section in `package.json` to enable eslint_d
|
|
||||||
-- "eslintConfig": {
|
|
||||||
-- "root": true,
|
|
||||||
-- "extends": [
|
|
||||||
-- "eslint:recommended",
|
|
||||||
-- "plugin:@typescript-eslint/recommended"
|
|
||||||
-- ],
|
|
||||||
-- "parser": "@typescript-eslint/parser",
|
|
||||||
-- "parserOptions": {
|
|
||||||
-- "project": [
|
|
||||||
-- "./tsconfig.json"
|
|
||||||
-- ]
|
|
||||||
-- },
|
|
||||||
-- "plugins": [
|
|
||||||
-- "@typescript-eslint"
|
|
||||||
-- ],
|
|
||||||
-- "rules": {
|
|
||||||
-- "@typescript-eslint/strict-boolean-expressions": [
|
|
||||||
-- 2,
|
|
||||||
-- {
|
|
||||||
-- "allowString": false,
|
|
||||||
-- "allowNumber": false
|
|
||||||
-- }
|
|
||||||
-- ]
|
|
||||||
-- },
|
|
||||||
-- "ignorePatterns": [
|
|
||||||
-- "src/**/*.test.ts",
|
|
||||||
-- "src/frontend/generated/*"
|
|
||||||
-- ]
|
|
||||||
-- }
|
|
||||||
|
|
||||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||||
|
|||||||
@@ -10,17 +10,17 @@ local on_attach = function(_, bufnr)
|
|||||||
vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc })
|
vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc })
|
||||||
end
|
end
|
||||||
|
|
||||||
nmap("<leader>cr", vim.lsp.buf.rename, "[R]e[n]ame")
|
nmap("<leader>cr", vim.lsp.buf.rename, "[R]ename Symbol")
|
||||||
nmap("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction")
|
nmap("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction")
|
||||||
-- See `:help K` for why this keymap
|
-- See `:help K` for why this keymap
|
||||||
nmap("K", vim.lsp.buf.hover, "Hover Documentation")
|
nmap("K", vim.lsp.buf.hover, "Hover Documentation")
|
||||||
-- nmap("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")
|
-- nmap("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")
|
||||||
|
|
||||||
-- Lesser used LSP functionality
|
-- Lesser used LSP functionality
|
||||||
nmap("<leader>cws", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols")
|
nmap("<leader>cS", require("telescope.builtin").lsp_dynamic_workspace_symbols, "Search Workspace [S]symbols")
|
||||||
nmap("<leader>cwl", function()
|
nmap("<leader>clf", function()
|
||||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
end, "[W]orkspace [L]ist Folders")
|
end, "Workspace [L]ist [F]olders")
|
||||||
|
|
||||||
-- Create a command `:Format` local to the LSP buffer
|
-- Create a command `:Format` local to the LSP buffer
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
|
vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
|
||||||
@@ -34,11 +34,11 @@ return {
|
|||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- Automatically install LSPs to stdpath for neovim
|
-- Automatically install LSPs to stdpath for neovim
|
||||||
{ "williamboman/mason.nvim", config = true },
|
{ "williamboman/mason.nvim", config = true },
|
||||||
{ "williamboman/mason-lspconfig.nvim" },
|
{ "williamboman/mason-lspconfig.nvim" },
|
||||||
|
|
||||||
-- Useful status updates for LSP
|
-- Useful status updates for LSP
|
||||||
{ "j-hui/fidget.nvim", opts = {} },
|
{ "j-hui/fidget.nvim", opts = {} },
|
||||||
|
|
||||||
{ "folke/neodev.nvim" },
|
{ "folke/neodev.nvim" },
|
||||||
},
|
},
|
||||||
@@ -84,7 +84,7 @@ return {
|
|||||||
cssls = {},
|
cssls = {},
|
||||||
dockerls = {},
|
dockerls = {},
|
||||||
docker_compose_language_service = {},
|
docker_compose_language_service = {},
|
||||||
html = { filetypes = { 'html', 'twig', 'hbs' } },
|
html = { filetypes = { "html", "twig", "hbs" } },
|
||||||
jsonls = {},
|
jsonls = {},
|
||||||
pyright = {},
|
pyright = {},
|
||||||
rust_analyzer = {},
|
rust_analyzer = {},
|
||||||
@@ -99,7 +99,7 @@ return {
|
|||||||
includeInlayPropertyDeclarationTypeHints = true,
|
includeInlayPropertyDeclarationTypeHints = true,
|
||||||
includeInlayFunctionLikeReturnTypeHints = true,
|
includeInlayFunctionLikeReturnTypeHints = true,
|
||||||
includeInlayEnumMemberValueHints = true,
|
includeInlayEnumMemberValueHints = true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
javascript = {
|
javascript = {
|
||||||
inlayHints = {
|
inlayHints = {
|
||||||
@@ -111,8 +111,8 @@ return {
|
|||||||
includeInlayPropertyDeclarationTypeHints = true,
|
includeInlayPropertyDeclarationTypeHints = true,
|
||||||
includeInlayFunctionLikeReturnTypeHints = true,
|
includeInlayFunctionLikeReturnTypeHints = true,
|
||||||
includeInlayEnumMemberValueHints = true,
|
includeInlayEnumMemberValueHints = true,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,14 +141,14 @@ return {
|
|||||||
"j-hui/fidget.nvim",
|
"j-hui/fidget.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
progress = {
|
progress = {
|
||||||
poll_rate = 1, -- How and when to poll for progress messages
|
poll_rate = 1, -- How and when to poll for progress messages
|
||||||
suppress_on_insert = true, -- Suppress new messages while in insert mode
|
suppress_on_insert = true, -- Suppress new messages while in insert mode
|
||||||
ignore_done_already = true, -- Ignore new tasks that are already complete
|
ignore_done_already = true, -- Ignore new tasks that are already complete
|
||||||
ignore_empty_message = true, -- Ignore new tasks that don't contain a message
|
ignore_empty_message = true, -- Ignore new tasks that don't contain a message
|
||||||
ignore = {}, -- List of LSP servers to ignore
|
ignore = {}, -- List of LSP servers to ignore
|
||||||
|
|
||||||
display = {
|
display = {
|
||||||
render_limit = 1, -- How many LSP messages to show at once
|
render_limit = 1, -- How many LSP messages to show at once
|
||||||
skip_history = true, -- Whether progress notifications should be omitted from history
|
skip_history = true, -- Whether progress notifications should be omitted from history
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ return {
|
|||||||
mappings = {
|
mappings = {
|
||||||
["s"] = "open_split", -- horizontal split
|
["s"] = "open_split", -- horizontal split
|
||||||
["v"] = "open_vsplit", -- vertical split
|
["v"] = "open_vsplit", -- vertical split
|
||||||
["Y"] = function(state)
|
["Y"] = function(state) -- Copy file's path to + register
|
||||||
local node = state.tree:get_node()
|
local node = state.tree:get_node()
|
||||||
local path = node:get_id()
|
local path = node:get_id()
|
||||||
vim.fn.setreg("+", path, "c")
|
vim.fn.setreg("+", path, "c")
|
||||||
@@ -142,9 +142,9 @@ return {
|
|||||||
-- Display undotree
|
-- Display undotree
|
||||||
{
|
{
|
||||||
"mbbill/undotree",
|
"mbbill/undotree",
|
||||||
config = function()
|
keys = {
|
||||||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
{ "<leader>u", "<cmd>UndotreeToggle<cr>", desc = "Toggle Undotree panel" },
|
||||||
end,
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Show buffers like VS Code tabs
|
-- Show buffers like VS Code tabs
|
||||||
@@ -157,6 +157,8 @@ return {
|
|||||||
keys = {
|
keys = {
|
||||||
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle buffer-pin" },
|
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle buffer-pin" },
|
||||||
{ "<leader>xo", "<Cmd>BufferLineCloseOthers<CR>", desc = "Delete other buffers" },
|
{ "<leader>xo", "<Cmd>BufferLineCloseOthers<CR>", desc = "Delete other buffers" },
|
||||||
|
{ "[b", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev buffer" },
|
||||||
|
{ "]b", "<cmd>BufferLineCycleNext<cr>", desc = "Next buffer" },
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
options = {
|
options = {
|
||||||
@@ -176,9 +178,6 @@ return {
|
|||||||
text_align = "left",
|
text_align = "left",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
numbers = function(opts)
|
|
||||||
return string.format("%s", opts.raise(opts.id))
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
@@ -306,9 +305,6 @@ return {
|
|||||||
inc_rename = true,
|
inc_rename = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
keys = {
|
|
||||||
{ "<leader>nx", "<cmd>NoiceDismiss<CR>", desc = "Dismiss all [N]oice notifications" },
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Set lualine as statusline
|
-- Set lualine as statusline
|
||||||
|
|||||||
@@ -79,8 +79,8 @@ return {
|
|||||||
vim.keymap.set("n", "<leader>lv", require("telescope.builtin").vim_options, { desc = "[L]ist [V]im Options" })
|
vim.keymap.set("n", "<leader>lv", require("telescope.builtin").vim_options, { desc = "[L]ist [V]im Options" })
|
||||||
|
|
||||||
-- Git things -> [G]it
|
-- Git things -> [G]it
|
||||||
vim.keymap.set("n", "<leader>gb", require("telescope.builtin").git_branches, { desc = "List [G]it [B]ranches" })
|
vim.keymap.set("n", "<leader>glb", require("telescope.builtin").git_branches, { desc = "List [G]it [B]ranches" })
|
||||||
vim.keymap.set("n", "<leader>gc", require("telescope.builtin").git_commits, { desc = "List [G]it [C]omits" })
|
vim.keymap.set("n", "<leader>glc", require("telescope.builtin").git_commits, { desc = "List [G]it [C]omits" })
|
||||||
|
|
||||||
-- LSP Things -> [C]oding
|
-- LSP Things -> [C]oding
|
||||||
vim.keymap.set("n", "<leader>cd", require("telescope.builtin").diagnostics, { desc = "[C]ode: List [D]iagnostics" })
|
vim.keymap.set("n", "<leader>cd", require("telescope.builtin").diagnostics, { desc = "[C]ode: List [D]iagnostics" })
|
||||||
|
|||||||
@@ -30,11 +30,16 @@ return {
|
|||||||
config = function()
|
config = function()
|
||||||
-- document existing key chains
|
-- document existing key chains
|
||||||
require("which-key").register({
|
require("which-key").register({
|
||||||
["<leader>e"] = { name = "[E]xplorer", _ = "which_key_ignore" },
|
|
||||||
["<leader>c"] = { name = "[C]ode", _ = "which_key_ignore" },
|
["<leader>c"] = { name = "[C]ode", _ = "which_key_ignore" },
|
||||||
["<leader>g"] = { name = "[G]it", _ = "which_key_ignore" },
|
["<leader>b"] = { name = "[B]buffer Operations", _ = "which_key_ignore" },
|
||||||
["<leader>s"] = { name = "[S]earch", _ = "which_key_ignore" },
|
["<leader>d"] = { name = "[D]iagnostics", _ = "which_key_ignore" },
|
||||||
["<leader>t"] = { name = "[T]oggle", _ = "which_key_ignore" },
|
["<leader>f"] = { name = "[F]ile Operations", _ = "which_key_ignore" },
|
||||||
|
["<leader>g"] = { name = "[G]it Operations", _ = "which_key_ignore" },
|
||||||
|
["<leader>l"] = { name = "[L]ist Things", _ = "which_key_ignore" },
|
||||||
|
["<leader>n"] = { name = "[N]VIM Operations", _ = "which_key_ignore" },
|
||||||
|
["<leader>s"] = { name = "[S]earch/Grep Things", _ = "which_key_ignore" },
|
||||||
|
["<leader>t"] = { name = "Unit [T]est Operations", _ = "which_key_ignore" },
|
||||||
|
["<leader>x"] = { name = "Delete/Remove Something", _ = "which_key_ignore" },
|
||||||
})
|
})
|
||||||
-- register which-key VISUAL mode
|
-- register which-key VISUAL mode
|
||||||
-- required for visual <leader>hs (hunk stage) to work
|
-- required for visual <leader>hs (hunk stage) to work
|
||||||
@@ -46,19 +51,13 @@ return {
|
|||||||
},
|
},
|
||||||
|
|
||||||
-- Session management. Saves your session in the background
|
-- Session management. Saves your session in the background
|
||||||
|
-- TIP: autocmd to autoload sessions at: ../config/autocmd.lua
|
||||||
{
|
{
|
||||||
"folke/persistence.nvim",
|
"folke/persistence.nvim",
|
||||||
event = "BufReadPre",
|
event = "BufReadPre",
|
||||||
opts = {
|
opts = {
|
||||||
-- Session files stored at: ~/.config/nvim/sessions/
|
-- Session files stored at: ~/.config/nvim/sessions/
|
||||||
dir = vim.fn.expand(vim.fn.stdpath("config") .. "/sessions/"),
|
dir = vim.fn.expand(vim.fn.stdpath("config") .. "/sessions/"),
|
||||||
options = vim.opt.sessionoptions:get(),
|
|
||||||
-- NOTE: autocmd to autoload sessions at: ../config/autocmd.lua
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
-- Since we are auto-restoring sessions, keymaps aren't required
|
|
||||||
-- { "<leader>sr", function() require("persistence").load() end, desc = "[R]estore [S]ession" },
|
|
||||||
-- { "<leader>sl", function() require("persistence").load({ last = true }) end, desc = "[R]estore [L]ast Session" },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
##################################################################################
|
##################################################################################
|
||||||
|
|
||||||
eval "$(ssh-agent -s)" >/dev/null
|
eval "$(ssh-agent -s)" >/dev/null
|
||||||
|
# shellcheck disable=SC3045
|
||||||
ulimit -n 10240
|
ulimit -n 10240
|
||||||
|
|
||||||
[ ! -f "$XDG_CONFIG_HOME/templates/.gitignore" ] || export GITIGNORE_TEMPLATE="$XDG_CONFIG_HOME/templates/.gitignore"
|
[ ! -f "$XDG_CONFIG_HOME/templates/.gitignore" ] || export GITIGNORE_TEMPLATE="$XDG_CONFIG_HOME/templates/.gitignore"
|
||||||
|
|||||||
Reference in New Issue
Block a user