made tab helper, relative movement

This commit is contained in:
2022-10-10 08:12:29 -05:00
parent 61446bb8e5
commit a8ad2d6fe8
17 changed files with 39 additions and 45 deletions
+15 -3
View File
@@ -1,9 +1,7 @@
-- SHOULD NOT CONTAIN ANY SETTINGS RELATED TO EXTERNAL PLUGINS
-- OR CUSTOM CODE YOU YOURSELF WROTE.
local helpers = require("helpers")
local map = helpers.map
local map = require("helpers").map
local opt = vim.opt
local g = vim.g
@@ -53,6 +51,20 @@ map("t", "<C-Space>", [[<C-\><C-n>]])
map("n", [[<Leader>\]], ":" .. term_command .. "<CR>")
map("n", [[<Leader>|]], ":v" .. term_command .. "<CR>")
-- Move cursor relative to visual line breaks
local function silent_map(mode, lhs, rhs)
map(mode, lhs, rhs, { silent = true })
end
silent_map("n", "<Up>", "gk")
silent_map("n", "<Down>", "gj")
silent_map("n", "<Home>", "g<Home>")
silent_map("n", "<End>", "g<End>")
silent_map("i", "<Up>", "<C-o>gk")
silent_map("i", "<Down>", "<C-o>gj")
silent_map("i", "<Home>", "<C-o>g<Home>")
silent_map("i", "<End>", "<C-o>g<End>")
opt.autoindent = true
opt.autoread = true
+5
View File
@@ -71,4 +71,9 @@ function M.lsp_config_defaults()
}
end
function M.set_tab(length)
vim.bo.shiftwidth = length
vim.bo.tabstop = length
end
return M
+6 -6
View File
@@ -36,11 +36,15 @@ function M.fzf()
map("n", "<Leader>r", ":Rg <C-R><C-W><CR>")
map("n", "<Leader>R", ":Rg<CR>")
map("n", "<Leader>s", ":Lines<CR>")
map("n", "<Leader>gf", ":GFiles<CR>")
map("n", "<Leader>gn", ":GFiles?<CR>")
map("n", "<Leader>gl", ":GFiles<CR>")
map("n", "<Leader>gs", ":GFiles?<CR>")
map("n", "<Leader>gc", ":Commits<CR>")
end
function M.fzf_checkout()
map("n", "<Leader>gb", ":GBranches<CR>")
end
function M.rnvimr()
map("n", "<Leader>f", [[:RnvimrToggle<CR>]])
end
@@ -72,10 +76,6 @@ function M.auto_session()
})
end
function M.fzf_checkout()
map("n", "<Leader>gb", ":GBranches<CR>")
end
function M.indent_blankline()
vim.opt.list = true
+1
View File
@@ -1,3 +1,4 @@
require("plugins.install_packer")
require("plugins.startup")
local config = require("plugins.config")