gitsigns keybinds, removed filetype plugins that set tab width, python
regex injections
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
require("helpers").set_tab(2)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
require("helpers").set_tab(2)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
require("helpers").set_tab(2)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
require("helpers").set_tab(2)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
require("helpers").set_tab(2)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
require("helpers").set_tab(2)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
require("helpers").set_tab(2)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
require("helpers").set_tab(4)
|
|
||||||
+2
-4
@@ -5,18 +5,16 @@ function M.map(mode, lhs, rhs, opts)
|
|||||||
if opts then
|
if opts then
|
||||||
default_opts = vim.tbl_extend("force", default_opts, opts)
|
default_opts = vim.tbl_extend("force", default_opts, opts)
|
||||||
end
|
end
|
||||||
vim.api.nvim_set_keymap(mode, lhs, rhs, default_opts)
|
--vim.api.nvim_set_keymap(mode, lhs, rhs, default_opts)
|
||||||
|
vim.keymap.set(mode, lhs, rhs, default_opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.lsp_config_defaults()
|
function M.lsp_config_defaults()
|
||||||
return {
|
return {
|
||||||
root_dir = require("lspconfig.util").root_pattern(
|
root_dir = require("lspconfig.util").root_pattern(
|
||||||
".ccls",
|
|
||||||
"manage.py",
|
|
||||||
"pyproject.toml",
|
"pyproject.toml",
|
||||||
"package.json",
|
"package.json",
|
||||||
".null-ls-root",
|
".null-ls-root",
|
||||||
"Makefile",
|
|
||||||
".git"
|
".git"
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|||||||
+69
-5
@@ -34,7 +34,11 @@ function M.fzf()
|
|||||||
map("n", "<Leader>gl", ":GFiles<CR>")
|
map("n", "<Leader>gl", ":GFiles<CR>")
|
||||||
map("n", "<Leader>gs", ":GFiles?<CR>")
|
map("n", "<Leader>gs", ":GFiles?<CR>")
|
||||||
map("n", "<Leader>gc", ":Commits<CR>")
|
map("n", "<Leader>gc", ":Commits<CR>")
|
||||||
map("n", "<Leader>l", ":lua require('fzf_funcs').cwd()<CR>")
|
--map("n", "<Leader>l", ":lua require('fzf_funcs').cwd()<CR>")
|
||||||
|
--map("n", "<Leader>f", ":lua require('fzf_funcs').cwd()<CR>")
|
||||||
|
|
||||||
|
local fzf = require("fzf_funcs")
|
||||||
|
map("n", "<Leader>l", fzf.cwd)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.fzf_checkout()
|
function M.fzf_checkout()
|
||||||
@@ -63,11 +67,14 @@ function M.harpoon()
|
|||||||
})
|
})
|
||||||
nmap("<Leader>a", ":lua require('harpoon.mark').add_file()<CR>")
|
nmap("<Leader>a", ":lua require('harpoon.mark').add_file()<CR>")
|
||||||
nmap("<Leader>m", ":lua require('harpoon.ui').toggle_quick_menu()<CR>")
|
nmap("<Leader>m", ":lua require('harpoon.ui').toggle_quick_menu()<CR>")
|
||||||
|
|
||||||
|
for i = 1, 4, 1 do
|
||||||
|
nmap("<C-" .. i .. ">", ':lua require("harpoon.ui").nav_file(' .. i .. ")<CR>")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.auto_session()
|
function M.auto_session()
|
||||||
require("auto-session").setup({
|
require("auto-session").setup({
|
||||||
log_level = "info",
|
|
||||||
auto_session_suppress_dirs = { "~/", "~/Projects" },
|
auto_session_suppress_dirs = { "~/", "~/Projects" },
|
||||||
auto_session_use_git_branch = true,
|
auto_session_use_git_branch = true,
|
||||||
})
|
})
|
||||||
@@ -180,7 +187,7 @@ function M.nvim_treesitter()
|
|||||||
html = true,
|
html = true,
|
||||||
javascript = true,
|
javascript = true,
|
||||||
typescript = true,
|
typescript = true,
|
||||||
svelte = true,
|
--svelte = true,
|
||||||
query = true,
|
query = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -206,7 +213,7 @@ function M.nvim_treesitter()
|
|||||||
disable = function(lang, bufnr)
|
disable = function(lang, bufnr)
|
||||||
return highlight_disable[lang] or too_many_lines(bufnr)
|
return highlight_disable[lang] or too_many_lines(bufnr)
|
||||||
end,
|
end,
|
||||||
additional_vim_regex_highlighting = { "htmldjango", "html" },
|
--additional_vim_regex_highlighting = { "htmldjango", "html" },
|
||||||
},
|
},
|
||||||
rainbow = {
|
rainbow = {
|
||||||
enable = true,
|
enable = true,
|
||||||
@@ -482,7 +489,64 @@ function M.tokyonight()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function M.gitsigns()
|
function M.gitsigns()
|
||||||
require("gitsigns").setup()
|
require("gitsigns").setup({
|
||||||
|
on_attach = function(bufnr)
|
||||||
|
local gs = package.loaded.gitsigns
|
||||||
|
|
||||||
|
local function gs_map(mode, l, r, opts)
|
||||||
|
opts = opts or {}
|
||||||
|
opts.buffer = bufnr
|
||||||
|
vim.keymap.set(mode, l, r, opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Navigation
|
||||||
|
gs_map("n", "]c", function()
|
||||||
|
if vim.wo.diff then
|
||||||
|
return "]c"
|
||||||
|
end
|
||||||
|
vim.schedule(function()
|
||||||
|
gs.next_hunk()
|
||||||
|
end)
|
||||||
|
return "<Ignore>"
|
||||||
|
end, { expr = true })
|
||||||
|
|
||||||
|
gs_map("n", "[c", function()
|
||||||
|
if vim.wo.diff then
|
||||||
|
return "[c"
|
||||||
|
end
|
||||||
|
vim.schedule(function()
|
||||||
|
gs.prev_hunk()
|
||||||
|
end)
|
||||||
|
return "<Ignore>"
|
||||||
|
end, { expr = true })
|
||||||
|
|
||||||
|
-- Actions
|
||||||
|
gs_map("n", "<leader>hs", gs.stage_hunk)
|
||||||
|
gs_map("n", "<leader>hr", gs.reset_hunk)
|
||||||
|
gs_map("v", "<leader>hs", function()
|
||||||
|
gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||||
|
end)
|
||||||
|
gs_map("v", "<leader>hr", function()
|
||||||
|
gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||||
|
end)
|
||||||
|
gs_map("n", "<leader>hS", gs.stage_buffer)
|
||||||
|
gs_map("n", "<leader>hu", gs.undo_stage_hunk)
|
||||||
|
gs_map("n", "<leader>hR", gs.reset_buffer)
|
||||||
|
gs_map("n", "<leader>hp", gs.preview_hunk)
|
||||||
|
gs_map("n", "<leader>hb", function()
|
||||||
|
gs.blame_line({ full = true })
|
||||||
|
end)
|
||||||
|
gs_map("n", "<leader>tb", gs.toggle_current_line_blame)
|
||||||
|
gs_map("n", "<leader>hd", gs.diffthis)
|
||||||
|
gs_map("n", "<leader>hD", function()
|
||||||
|
gs.diffthis("~")
|
||||||
|
end)
|
||||||
|
gs_map("n", "<leader>td", gs.toggle_deleted)
|
||||||
|
|
||||||
|
-- Text object
|
||||||
|
gs_map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>")
|
||||||
|
end,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.lsp_zero()
|
function M.lsp_zero()
|
||||||
|
|||||||
@@ -9,3 +9,8 @@
|
|||||||
(type (string (string_content) @_type))
|
(type (string (string_content) @_type))
|
||||||
(string (string_content) @python))
|
(string (string_content) @python))
|
||||||
(#eq? @_type "TypeAlias"))
|
(#eq? @_type "TypeAlias"))
|
||||||
|
|
||||||
|
(class_definition (argument_list (subscript (string (string_content) @python))))
|
||||||
|
|
||||||
|
(((string (string_content) @python) @_str)
|
||||||
|
(#match? @_str "^r.*$"))
|
||||||
|
|||||||
Reference in New Issue
Block a user