-- HELPERS ----------------------------------------------------
local cmd = vim.cmd  -- to execute Vim commands e.g. cmd('pwd')
local fn = vim.fn    -- to call Vim functions e.g. fn.bufnr()
local g = vim.g      -- a table to access global variables
local keymap = vim.keymap -- keymap
local scopes = {o = vim.o, b = vim.bo, w = vim.wo}

g.mapleader = ';'

keymap.set('n', '<leader>sw', '<c-w>')
keymap.set('n', '<leader>sww', '<c-w>k')
keymap.set('n', '<leader>sws', '<c-w>j')
keymap.set('n', '<leader>swa', '<c-w>h')
keymap.set('n', '<leader>swd', '<c-w>l')

keymap.set('n', '<leader><leader>a', 'gT')
keymap.set('n', '<leader><leader>d', 'gt')

keymap.set('n', '<F9>', ':%!jq .<CR>')

keymap.set('n', '<leader>sg', ':lua vim.diagnostic.open_float(0, {scope="line"})<CR>')

if vim.api.nvim_win_get_option(0, "diff") then
  keymap.set('n', '<leader>1', ':diffget LOCAL<CR>')
  keymap.set('n', '<leader>2', ':diffget REMOTE<CR>')
  keymap.set('n', '<leader>3', ':%diffget LOCAL<CR>')
end
