require "core" vim.api.nvim_set_var('mapleader', ';') pcall(require, 'custom') 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" -- new from v3.0 vim.schedule(function() require "core.mappings" end, 0) -- 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 }) -- Set the tab width to 4 spaces vim.cmd('set tabstop=4') vim.cmd('set shiftwidth=4') vim.cmd('set expandtab') vim.o.hidden = true -- Git diffthis vim.api.nvim_set_keymap('n', 'gd', ':Gitsigns diffthis', {noremap = true, silent = true})