require "core" vim.api.nvim_set_var('mapleader', ';') local custom_init_path = vim.api.nvim_get_runtime_file("lua/custom/init.lua", false)[1] if custom_init_path then dofile(custom_init_path) end require("core.utils").load_mappings() local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" -- bootstrap lazy.nvim! if not vim.loop.fs_stat(lazypath) then require("core.bootstrap").gen_chadrc_template() require("core.bootstrap").lazy(lazypath) end dofile(vim.g.base46_cache .. "defaults") vim.opt.rtp:prepend(lazypath) require "plugins" -- Configure Telescope to scroll files with ctrl+j/k local actions = require('telescope.actions') local sorters = require('telescope.sorters') require('telescope').setup { defaults = { mappings = { i = { [""] = actions.move_selection_next, [""] = actions.move_selection_previous, }, }, file_sorter = sorters.get_fzy_sorter, file_ignore_patterns = { '.git/*', 'node_modules/*', 'vendor/*' }, generic_sorter = sorters.get_generic_fuzzy_sorter, }, extensions = { fzf = { fuzzy = true, override_generic_sorter = true, override_file_sorter = true, case_mode = "smart_case", } } } vim.api.nvim_set_keymap('n', 'e', ':NvimTreeToggle', {noremap = true, silent = true}) -- Cycle through open buffers with leader+a vim.api.nvim_set_keymap('n', 'a', ':bprevious', {noremap = true, silent = true}) vim.api.nvim_set_keymap('n', 'f', ':bnext', {noremap = true, silent = true}) local builtin = require('telescope.builtin') vim.keymap.set('n', 'ff', builtin.find_files, {}) -- move the whole page without moving the cursor vim.api.nvim_set_keymap('n', 'J', '', { noremap = true }) vim.api.nvim_set_keymap('n', 'K', '', { noremap = true }) -- Resize windows vim.api.nvim_set_keymap('n', '', '5+', { silent = true }) vim.api.nvim_set_keymap('n', '', '5-', { silent = true }) vim.api.nvim_set_keymap('n', '', '10>', { silent = true }) vim.api.nvim_set_keymap('n', '', '10<', { silent = true })