You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.9 KiB
Lua

vim.g.mapleader = " "
vim.keymap.set("n", "<leader>b", ":lua ToggleTransparent()<CR>")
-- nvim-tree bindings
vim.keymap.set("n", "<leader>t", ":NvimTreeToggle<CR>")
vim.keymap.set("n", "<leader>a", ":lua SpellToggle()<CR>")
-- markdown preview
vim.keymap.set("n", "<leader>p", ":MarkdownPreviewToggle<CR>")
-- custom shell script to move windows
vim.cmd([[
function OpenMarkdownPreview (url)
execute "silent ! markdown-preview.sh " . a:url
endfunction
]])
vim.g.mkdp_browserfunc = 'OpenMarkdownPreview'
-- git actions
vim.keymap.set("n", "<leader>ga", ":Git add .<CR>")
vim.keymap.set("n", "<leader>gm", ":Git commit<CR>")
-- fuzzy finder keybindings
local telescope = require('telescope.builtin')
vim.keymap.set('n','<leader>f', telescope.find_files, {})
vim.keymap.set('n','<leader>s', telescope.spell_suggest, {})
-- global copy/paste
vim.keymap.set('n', '<leader>yg', '"+y')
vim.keymap.set('n', '<leader>pg', '"+p')
-- toggle dotfiles visibility
vim.keymap.set("n", "<leader>d", ":lua require('nvim-tree.api').tree.toggle_hidden_filter()<CR>")
-- harpoon bindings
vim.keymap.set("n", "<leader>hs", ":Telescope harpoon marks<CR>")
vim.keymap.set("n", "<leader>hh", ":lua require('harpoon.ui').toggle_quick_menu()<CR>")
vim.keymap.set("n", "<leader>ha", ":lua require('harpoon.mark').add_file()<CR>")
--vim.keymap.set("n", "<leader>ha", harpoon.mark.add_file, {})
vim.keymap.set("n", "<leader>hn", ":lua require('harpoon.ui').nav_next()<CR>")
vim.keymap.set("n", "<leader>hp", ":lua require('harpoon.ui').nav_prev()<CR>")
-- jumping to specific files
vim.keymap.set("n", "<leader>h1", ":lua require('harpoon.ui').nav_file(1)<CR>")
vim.keymap.set("n", "<leader>h2", ":lua require('harpoon.ui').nav_file(2)<CR>")
vim.keymap.set("n", "<leader>h3", ":lua require('harpoon.ui').nav_file(3)<CR>")
vim.keymap.set("n", "<leader>h4", ":lua require('harpoon.ui').nav_file(4)<CR>")
vim.keymap.set("n", "<leader>h5", ":lua require('harpoon.ui').nav_file(5)<CR>")