Move keymaps into config init

This commit is contained in:
Evie Litherland-Smith 2023-03-06 10:31:34 +00:00
parent 790bc2cb98
commit 7c9d636378
2 changed files with 64 additions and 59 deletions

View file

@ -1,18 +1,11 @@
-- Opt
vim.opt.title = true vim.opt.title = true
vim.opt.cmdheight = 0 vim.opt.cmdheight = 0
vim.g.python3_host_prog = vim.fn.stdpath "config" .. "/.venv/bin/python"
vim.g.python_indent = {
open_paren = "shiftwidth()",
nested_paren = "shiftwidth()",
continue = "shiftwidth()",
closed_paren_align_last_line = "v:false",
}
vim.opt.laststatus = 3 vim.opt.laststatus = 3
vim.opt.mouse = "nv"
vim.opt.shiftwidth = 4 vim.opt.shiftwidth = 4
vim.opt.number = true vim.opt.number = true
vim.opt.relativenumber = true vim.opt.relativenumber = true
vim.opt.listchars = { trail = ".", tab = ">_" } vim.opt.listchars = { lead = ".", trail = "-", tab = ">_" }
vim.opt.list = true vim.opt.list = true
vim.opt.wrap = true vim.opt.wrap = true
vim.opt.linebreak = true vim.opt.linebreak = true
@ -22,4 +15,65 @@ vim.opt.autoindent = true
vim.opt.smartindent = true vim.opt.smartindent = true
vim.opt.splitbelow = true vim.opt.splitbelow = true
vim.opt.splitright = true vim.opt.splitright = true
require "config.keymaps"
-- Global
vim.g.python3_host_prog = vim.fn.stdpath "config" .. "/.venv/bin/python"
-- vim.g.python_indent = {
-- open_paren = "shiftwidth()",
-- nested_paren = "shiftwidth()",
-- continue = "shiftwidth()",
-- closed_paren_align_last_line = "v:false",
-- }
vim.g.loaded_ruby_provider = 0
vim.g.loaded_perl_provider = 0
-- Keymaps
vim.keymap.set("i", "jk", "<esc>")
vim.keymap.set("n", "<leader>l", "<cmd>Lazy<CR>")
vim.keymap.set("n", "<leader>m", "<cmd>Mason<CR>")
vim.keymap.set("n", "<leader>s", "<cmd>Dashboard<CR>")
vim.keymap.set({ "n", "t" }, "<A-h>", "<CMD>NavigatorLeft<CR>")
vim.keymap.set({ "n", "t" }, "<A-l>", "<CMD>NavigatorRight<CR>")
vim.keymap.set({ "n", "t" }, "<A-k>", "<CMD>NavigatorUp<CR>")
vim.keymap.set({ "n", "t" }, "<A-j>", "<CMD>NavigatorDown<CR>")
vim.keymap.set({ "n", "t" }, "<A-p>", "<CMD>NavigatorPrevious<CR>")
-- Telescope
vim.keymap.set("n", "<leader>;", "<cmd>Telescope builtin<cr>")
vim.keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>")
vim.keymap.set("n", "<leader>fb", "<cmd>Telescope buffers<cr>")
vim.keymap.set("n", "<leader>fg", "<cmd>Telescope live_grep<cr>")
vim.keymap.set("n", "<leader>fl", "<cmd>Telescope lsp_document_symbols<cr>")
vim.keymap.set("n", "<leader>fe", "<cmd>Telescope diagnostics<cr>")
vim.keymap.set("n", "<leader>fs", "<cmd>Telescope treesitter<cr>")
vim.keymap.set("n", "<leader>fz", "<cmd>Telescope current_buffer_fuzzy_find<cr>")
vim.keymap.set("n", "<leader>fa", "<cmd>Telescope aerial<cr>")
-- Neotree
vim.keymap.set("n", "<leader>n", "<cmd>Neotree toggle<cr>")
vim.keymap.set("n", "<leader>\\", "<cmd>Neotree reveal<cr>")
-- Aerial
vim.keymap.set("n", "<leader>a", "<cmd>AerialToggle!<CR>")
-- diffview
vim.keymap.set("n", "<leader>do", "<cmd>DiffviewOpen<cr>")
vim.keymap.set("n", "<leader>dc", "<cmd>DiffviewClose<cr>")
vim.keymap.set("n", "<leader>dh", "<cmd>DiffviewFileHistory<cr>")
vim.keymap.set("n", "<leader>df", "<cmd>DiffviewFileHistory %<cr>")
-- Trouble
vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>")
vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>")
vim.keymap.set("n", "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>")
vim.keymap.set("n", "<leader>xq", "<cmd>TroubleToggle quickfix<cr>")
vim.keymap.set("n", "<leader>xl", "<cmd>TroubleToggle loclist<cr>")
-- nvim-test
vim.keymap.set("n", "<leader>ts", "<cmd>TestSuite<cr>")
vim.keymap.set("n", "<leader>tf", "<cmd>TestFile<cr>")
vim.keymap.set("n", "<leader>te", "<cmd>TestEdit<cr>")
vim.keymap.set("n", "<leader>tn", "<cmd>TestNearest<cr>")
vim.keymap.set("n", "<leader>tl", "<cmd>TestLast<cr>")
vim.keymap.set("n", "<leader>tv", "<cmd>TestVisit<cr>")
vim.keymap.set("n", "<leader>ti", "<cmd>TestInfo<cr>")

View file

@ -1,49 +0,0 @@
vim.keymap.set("i", "jk", "<esc>")
vim.keymap.set("n", "<leader>l", "<cmd>Lazy<CR>")
vim.keymap.set("n", "<leader>m", "<cmd>Mason<CR>")
vim.keymap.set("n", "<leader>s", "<cmd>Dashboard<CR>")
vim.keymap.set({ "n", "t" }, "<A-h>", "<CMD>NavigatorLeft<CR>")
vim.keymap.set({ "n", "t" }, "<A-l>", "<CMD>NavigatorRight<CR>")
vim.keymap.set({ "n", "t" }, "<A-k>", "<CMD>NavigatorUp<CR>")
vim.keymap.set({ "n", "t" }, "<A-j>", "<CMD>NavigatorDown<CR>")
vim.keymap.set({ "n", "t" }, "<A-p>", "<CMD>NavigatorPrevious<CR>")
-- Telescope
vim.keymap.set("n", "<leader>;", "<cmd>Telescope builtin<cr>")
vim.keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>")
vim.keymap.set("n", "<leader>fb", "<cmd>Telescope buffers<cr>")
vim.keymap.set("n", "<leader>fg", "<cmd>Telescope live_grep<cr>")
vim.keymap.set("n", "<leader>fl", "<cmd>Telescope lsp_document_symbols<cr>")
vim.keymap.set("n", "<leader>fe", "<cmd>Telescope diagnostics<cr>")
vim.keymap.set("n", "<leader>fs", "<cmd>Telescope treesitter<cr>")
vim.keymap.set("n", "<leader>fz", "<cmd>Telescope current_buffer_fuzzy_find<cr>")
vim.keymap.set("n", "<leader>fa", "<cmd>Telescope aerial<cr>")
-- Neotree
vim.keymap.set("n", "<leader>n", "<cmd>Neotree toggle<cr>")
vim.keymap.set("n", "<leader>\\", "<cmd>Neotree reveal<cr>")
-- Aerial
vim.keymap.set("n", "<leader>a", "<cmd>AerialToggle!<CR>")
-- diffview
vim.keymap.set("n", "<leader>do", "<cmd>DiffviewOpen<cr>")
vim.keymap.set("n", "<leader>dc", "<cmd>DiffviewClose<cr>")
vim.keymap.set("n", "<leader>dh", "<cmd>DiffviewFileHistory<cr>")
vim.keymap.set("n", "<leader>df", "<cmd>DiffviewFileHistory %<cr>")
-- Trouble
vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>")
vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>")
vim.keymap.set("n", "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>")
vim.keymap.set("n", "<leader>xq", "<cmd>TroubleToggle quickfix<cr>")
vim.keymap.set("n", "<leader>xl", "<cmd>TroubleToggle loclist<cr>")
-- nvim-test
vim.keymap.set("n", "<leader>ts", "<cmd>TestSuite<cr>")
vim.keymap.set("n", "<leader>tf", "<cmd>TestFile<cr>")
vim.keymap.set("n", "<leader>te", "<cmd>TestEdit<cr>")
vim.keymap.set("n", "<leader>tn", "<cmd>TestNearest<cr>")
vim.keymap.set("n", "<leader>tl", "<cmd>TestLast<cr>")
vim.keymap.set("n", "<leader>tv", "<cmd>TestVisit<cr>")
vim.keymap.set("n", "<leader>ti", "<cmd>TestInfo<cr>")