mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
NeoVim & VIM
- Testing setup through neotest plugin - Spellcheck enabled on markdown and text files - Diagnosis summary through trouble plugin - Code completion keybindings improved - Auto-formatting through conform plugin - Reactjs context aware commenting through nvim-ts-context-commentstring - Auto HTML tag completion through nvim-ts-autotag - CSS color highlight through nvim-highlight-colors - Lualine: breadcrumbs, git status, single line - Auto restore neovim sessions - Better keyboard maps Shell - Aliases now load from .bashrc or .zshrc - Bash & zsh shortcuts to easy open and create projects - zoxide instead of cd when installed - bootstrap.sh shellhardened
This commit is contained in:
@@ -5,7 +5,16 @@ return {
|
||||
{ "machakann/vim-highlightedyank" },
|
||||
|
||||
-- "gc" to comment visual regions/lines
|
||||
{ "numToStr/Comment.nvim", opts = {} },
|
||||
{
|
||||
"numToStr/Comment.nvim",
|
||||
config = function()
|
||||
require("Comment").setup({
|
||||
pre_hook = function()
|
||||
return vim.bo.commentstring
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- auto pairs
|
||||
{
|
||||
@@ -18,13 +27,21 @@ return {
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
opts = {
|
||||
indent = { char = "│", tab_char = "│", },
|
||||
indent = { char = "│", tab_char = "│" },
|
||||
scope = { enabled = false },
|
||||
exclude = {
|
||||
filetypes = {
|
||||
"help", "alpha", "dashboard", "neo-tree",
|
||||
"Trouble", "trouble", "lazy", "mason",
|
||||
"notify", "toggleterm", "lazyterm",
|
||||
"help",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
"lazyterm",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -34,13 +51,18 @@ return {
|
||||
-- Highlights the current level of indentation, and animates the highlighting.
|
||||
{
|
||||
"echasnovski/mini.indentscope",
|
||||
opts = { symbol = "│", options = { try_as_border = true }, },
|
||||
opts = { symbol = "│", options = { try_as_border = true } },
|
||||
init = function()
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"help", "neo-tree", "Trouble", "trouble",
|
||||
"lazy", "mason", "notify", "toggleterm",
|
||||
"lazyterm",
|
||||
"help",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
},
|
||||
callback = function()
|
||||
vim.b.miniindentscope_disable = true
|
||||
@@ -61,14 +83,134 @@ return {
|
||||
},
|
||||
},
|
||||
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" },
|
||||
{
|
||||
"]t",
|
||||
function()
|
||||
require("todo-comments").jump_next()
|
||||
end,
|
||||
desc = "Next todo comment",
|
||||
},
|
||||
{
|
||||
"[t",
|
||||
function()
|
||||
require("todo-comments").jump_prev()
|
||||
end,
|
||||
desc = "Previous todo comment",
|
||||
},
|
||||
|
||||
-- TODO: Find better keymaps for below
|
||||
-- { "<leader>xt", "<cmd>TodoTrouble<cr>", desc = "Todo (Trouble)" },
|
||||
-- { "<leader>xT", "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme (Trouble)" },
|
||||
-- { "<leader>st", "<cmd>TodoTelescope<cr>", desc = "Todo" },
|
||||
-- { "<leader>sT", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme" },
|
||||
{ "<leader>dt", "<cmd>TodoTrouble<cr>", desc = "Todo (Trouble)" },
|
||||
{ "<leader>dT", "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme (Trouble)" },
|
||||
-- TODO: Include hidden files
|
||||
{ "<leader>lt", "<cmd>TodoTelescope<cr>", desc = "List Todo" },
|
||||
{ "<leader>lT", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>", desc = "List Todo/Fix/Fixme" },
|
||||
},
|
||||
},
|
||||
|
||||
-- better diagnostics list and others
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
cmd = { "TroubleToggle", "Trouble" },
|
||||
opts = { use_diagnostic_signs = true },
|
||||
keys = {
|
||||
{ "<leader>dx", "<cmd>TroubleToggle document_diagnostics<cr>", desc = "Document Diagnostics (Trouble)" },
|
||||
{ "<leader>dw", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Workspace Diagnostics (Trouble)" },
|
||||
{ "<leader>dl", "<cmd>TroubleToggle loclist<cr>", desc = "Location List (Trouble)" },
|
||||
{ "<leader>dq", "<cmd>TroubleToggle quickfix<cr>", desc = "Quickfix List (Trouble)" },
|
||||
{
|
||||
"[q",
|
||||
function()
|
||||
if require("trouble").is_open() then
|
||||
require("trouble").previous({ skip_groups = true, jump = true })
|
||||
else
|
||||
local ok, err = pcall(vim.cmd.cprev)
|
||||
if not ok then
|
||||
vim.notify(err, vim.log.levels.ERROR)
|
||||
end
|
||||
end
|
||||
end,
|
||||
desc = "Previous trouble/quickfix item",
|
||||
},
|
||||
{
|
||||
"]q",
|
||||
function()
|
||||
if require("trouble").is_open() then
|
||||
require("trouble").next({ skip_groups = true, jump = true })
|
||||
else
|
||||
local ok, err = pcall(vim.cmd.cnext)
|
||||
if not ok then
|
||||
vim.notify(err, vim.log.levels.ERROR)
|
||||
end
|
||||
end
|
||||
end,
|
||||
desc = "Next trouble/quickfix item",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Inlay hints
|
||||
{
|
||||
"lvimuser/lsp-inlayhints.nvim",
|
||||
config = function()
|
||||
require("lsp-inlayhints").setup()
|
||||
|
||||
-- Lazy load on LspAttach
|
||||
vim.api.nvim_create_augroup("LspAttach_inlayhints", {})
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = "LspAttach_inlayhints",
|
||||
callback = function(args)
|
||||
if not (args.data and args.data.client_id) then
|
||||
return
|
||||
end
|
||||
|
||||
local bufnr = args.buf
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
require("lsp-inlayhints").on_attach(client, bufnr)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Lsp Breadcrumbs for lualine
|
||||
{
|
||||
"SmiteshP/nvim-navic",
|
||||
lazy = true,
|
||||
init = function()
|
||||
vim.g.navic_silence = true
|
||||
require("config.util").on_lsp_attach(function(client, buffer)
|
||||
if client.supports_method("textDocument/documentSymbol") then
|
||||
require("nvim-navic").attach(client, buffer)
|
||||
end
|
||||
end)
|
||||
end,
|
||||
opts = function()
|
||||
return {
|
||||
separator = " ",
|
||||
highlight = true,
|
||||
depth_limit = 5,
|
||||
icons = require("config.util").icons.kinds,
|
||||
lazy_update_context = true,
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"SmiteshP/nvim-navbuddy",
|
||||
dependencies = {
|
||||
"SmiteshP/nvim-navic",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
opts = {
|
||||
lsp = { auto_attach = true },
|
||||
icons = require("config.util").icons.kinds,
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>v",
|
||||
function()
|
||||
return require("nvim-navbuddy").open()
|
||||
end,
|
||||
desc = "N[v]igate through document symbols",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user