Housekeeping: VSCode, zshrc

NeoVIM:
- Housekeeping: Keymap updates to git, Code(TS), whichkey hints added
  for harpoon, git, DB
This commit is contained in:
Pratik Tripathy
2024-03-17 17:36:36 +05:30
parent 42d75df1f1
commit d41d26d5f7
9 changed files with 51 additions and 52 deletions

View File

@@ -185,8 +185,6 @@
"markdownlint.config": {
"default": true,
"MD007": false,
"MD024": false,
"MD029": false,
"MD030": false,
"MD033": false,
"MD046": false,

View File

@@ -14,6 +14,7 @@
-- g+: [G]it Operations
-- l+: [L]ist Things
-- n+: [N]eoVim Stuff
-- q+: DB [Q]ueries
-- s+: Grep/[S]earch Things
-- t+: [T]est runner stuff
-- x+: close/dismiss something

View File

@@ -9,7 +9,7 @@ return {
-- FIX: Open files do NOT get replaced with the changed branch
require("telescope").load_extension("git_worktree")
vim.keymap.set("n", "<leader>glw", "<cmd> lua require('telescope').extensions.git_worktree.git_worktrees()<CR>")
vim.keymap.set("n", "<leader>gw", "<cmd> lua require('telescope').extensions.git_worktree.git_worktrees()<CR>")
end,
},
@@ -26,7 +26,7 @@ return {
changedelete = { text = "~" },
untracked = { text = "" },
},
attach_to_untracker = true,
attach_to_untracked = true,
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
@@ -63,6 +63,9 @@ return {
map("n", "<leader>gsh", gs.stage_hunk, { desc = "Git: Stage Hunk" })
map("n", "<leader>gsu", gs.undo_stage_hunk, { desc = "Git: Undo Stage Hunk" })
map("n", "<leader>gsb", gs.stage_buffer, { desc = "Git: Stage Current File" })
map("n", "<leader>gb", function()
gs.blame_line({ full = true })
end, { desc = "Git: Hover blame-line" })
-- visual mode
map("v", "<leader>gsH", function()

View File

@@ -58,9 +58,6 @@ return {
-- Add any additional override configuration in the following tables. They will be passed to the `settings` field of the server config
-- If you want to override the default filetypes that your language server will attach to you can define the property 'filetypes' to the map in question.
local servers = {
-- clangd = {},
-- gopls = {},
lua_ls = {
Lua = {
workspace = { checkThirdParty = false },
@@ -70,50 +67,9 @@ return {
-- diagnostics = { disable = { 'missing-fields' } },
},
},
-- Markdown
marksman = {},
awk_ls = {},
bashls = {
filetypes = { "sh", "bash", "zsh" },
},
cssls = {},
dockerls = {},
docker_compose_language_service = {},
bashls = { filetypes = { "sh", "bash", "zsh" } },
html = { filetypes = { "html", "twig", "hbs" } },
jsonls = {},
pyright = {},
rust_analyzer = {},
tsserver = {
-- keys = {
-- {
-- "<leader>co",
-- function()
-- vim.lsp.buf.code_action({
-- apply = true,
-- context = {
-- only = { "source.organizeImports.ts" },
-- diagnostics = {},
-- },
-- })
-- end,
-- desc = "Typescript: Organize Imports",
-- },
-- {
-- "<leader>cO",
-- function()
-- vim.lsp.buf.code_action({
-- apply = true,
-- context = {
-- only = { "source.removeUnused.ts" },
-- diagnostics = {},
-- },
-- })
-- end,
-- desc = "Typescript: Remove Unused Imports",
-- },
-- },
settings = {
completions = {
completeFunctionCalls = true,
@@ -144,6 +100,17 @@ return {
},
},
},
-- https://github.com/joe-re/sql-language-server?tab=readme-ov-file#configuration
sqlls = {},
marksman = {},
awk_ls = {},
cssls = {},
dockerls = {},
docker_compose_language_service = {},
jsonls = {},
pyright = {},
rust_analyzer = {},
}
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
@@ -184,6 +151,34 @@ return {
end,
})
end,
keys = {
{
"<leader>co",
function()
vim.lsp.buf.code_action({
apply = true,
context = {
only = { "source.organizeImports.ts" },
diagnostics = {},
},
})
end,
desc = "Typescript: Organize Imports",
},
{
"<leader>cO",
function()
vim.lsp.buf.code_action({
apply = true,
context = {
only = { "source.removeUnused.ts" },
diagnostics = {},
},
})
end,
desc = "Typescript: Remove Unused Imports",
},
},
},
{

View File

@@ -206,7 +206,6 @@ return {
{
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
lazy = false,
dependencies = {
"nvim-lua/plenary.nvim",
{

View File

@@ -155,6 +155,7 @@ return {
{ find = ">ed" },
{ find = "<ed" },
{ find = "The only match" },
{ find = "DB:" },
},
},
},

View File

@@ -50,9 +50,11 @@ return {
["<leader>b"] = { name = "Buffer Operations", _ = "which_key_ignore" },
["<leader>d"] = { name = "Diagnostics", _ = "which_key_ignore" },
["<leader>f"] = { name = "File Operations", _ = "which_key_ignore" },
["<leader>g"] = { name = "Git Operations", _ = "which_key_ignore" },
["<leader>g"] = { name = "Git", _ = "which_key_ignore" },
["<leader>h"] = { name = "Harpoon", _ = "which_key_ignore" },
["<leader>l"] = { name = "List Things", _ = "which_key_ignore" },
["<leader>n"] = { name = "NVIM Operations", _ = "which_key_ignore" },
["<leader>q"] = { name = "Database Query", _ = "which_key_ignore" },
["<leader>s"] = { name = "Search/Grep Things", _ = "which_key_ignore" },
["<leader>t"] = { name = "Unit Test Operations", _ = "which_key_ignore" },
["<leader>x"] = { name = "Delete/Remove Something", _ = "which_key_ignore" },