-- Insert mode bindings
vim.keymap.set('i','jk','<Esc>', {noremap=true, silent=true})
vim.keymap.set('i','÷','()<Esc>i', {noremap=true, silent=true})

vim.keymap.set('n','<space><tab>',':b#<CR>', {noremap=true, silent=true})
vim.keymap.set('n', '<leader>cd', ':cd %:p:h<CR>', {noremap=true, silent=true})

vim.api.nvim_set_keymap('n', '<leader>ff', '<cmd>Telescope find_files<cr>', {noremap = true, silent = true})
vim.api.nvim_set_keymap('n', '<leader>rg', '<cmd>Telescope grep_string search="" only_sort_text=true<cr>', {noremap = true, silent = true})
vim.api.nvim_set_keymap('n', '<leader>bb', '<cmd>Telescope buffers<cr>', {noremap = true, silent = true})
vim.api.nvim_set_keymap('n', '<leader>fh', '<cmd>Telescope help_tags<cr>', {noremap = true, silent = true})

vim.keymap.set('n', '-', '/', { noremap = true, silent = true })
vim.keymap.set('n', '<F1>', function() vim.cmd('e ~/.config/nvim/init.vim') end, { noremap = true, silent = true })
vim.keymap.set('n','<F4>',':set hlsearch!<CR>',{ noremap = true, silent = true })
vim.keymap.set('n','<F12>',':set number!<CR>',{ noremap = true, silent = true })
vim.keymap.set('n','<leader>ss', function() vim.cmd('LinesWithPreview') end,{ noremap = true, silent = true })
vim.keymap.set('n', 'á', '`', { noremap = true, silent = true })
vim.keymap.set('n', 'z7', '<cmd>Telescope spell_suggest<cr>', { noremap = true, silent = true })
vim.keymap.set('n', '<F5>', ':set ignorecase!<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<F6>',':set spell! spelllang=hu<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<F7>',':set spell! spelllang=en<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap(
  "n", 
  "<space>lf", 
  "<cmd>lua require('custom.fold_telescope').jump_to_fold_starts()<CR>", 
  { noremap = true, silent = true }
)

vim.api.nvim_set_keymap(
  "n", 
  "<space>ll", 
  "<cmd>lua require('custom.line_telescope').jump_to_line()<CR>", 
  { noremap = true, silent = true }
)
