2022-05-23 03:24:03 -04:00
|
|
|
require "core"
|
2023-04-02 02:06:19 -04:00
|
|
|
vim.api.nvim_set_var('mapleader', ';')
|
2022-05-23 05:24:59 -04:00
|
|
|
|
2022-12-17 06:34:52 -05:00
|
|
|
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
|
2022-08-15 09:53:55 -04:00
|
|
|
|
2023-03-01 03:59:12 -05:00
|
|
|
require("core.utils").load_mappings()
|
|
|
|
|
2023-01-07 03:11:43 -05:00
|
|
|
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
|
|
|
|
|
2023-03-01 03:59:12 -05:00
|
|
|
-- bootstrap lazy.nvim!
|
2023-01-07 03:11:43 -05:00
|
|
|
if not vim.loop.fs_stat(lazypath) then
|
|
|
|
require("core.bootstrap").gen_chadrc_template()
|
|
|
|
require("core.bootstrap").lazy(lazypath)
|
|
|
|
end
|
|
|
|
|
2023-03-24 22:45:53 -04:00
|
|
|
dofile(vim.g.base46_cache .. "defaults")
|
2023-01-07 03:11:43 -05:00
|
|
|
vim.opt.rtp:prepend(lazypath)
|
|
|
|
require "plugins"
|
2023-04-02 02:06:19 -04:00
|
|
|
|
|
|
|
-- 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 = {
|
|
|
|
["<C-j>"] = actions.move_selection_next,
|
|
|
|
["<C-k>"] = 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', '<leader>e', ':NvimTreeToggle<CR>', {noremap = true, silent = true})
|
|
|
|
|
|
|
|
-- Cycle through open buffers with leader+a
|
|
|
|
vim.api.nvim_set_keymap('n', '<leader>a', ':bprevious<CR>', {noremap = true, silent = true})
|
|
|
|
vim.api.nvim_set_keymap('n', '<leader>f', ':bnext<CR>', {noremap = true, silent = true})
|
|
|
|
|
|
|
|
local builtin = require('telescope.builtin')
|
|
|
|
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
2023-04-04 13:53:43 -04:00
|
|
|
|
|
|
|
-- move the whole page without moving the cursor
|
|
|
|
vim.api.nvim_set_keymap('n', 'J', '<C-e>', { noremap = true })
|
|
|
|
vim.api.nvim_set_keymap('n', 'K', '<C-y>', { noremap = true })
|
|
|
|
|
|
|
|
-- Resize windows
|
|
|
|
vim.api.nvim_set_keymap('n', '<Up>', '5<C-w>+', { silent = true })
|
|
|
|
vim.api.nvim_set_keymap('n', '<Down>', '5<C-w>-', { silent = true })
|
|
|
|
vim.api.nvim_set_keymap('n', '<Right>', '10<C-w>>', { silent = true })
|
|
|
|
vim.api.nvim_set_keymap('n', '<Left>', '10<C-w><', { silent = true })
|
|
|
|
|
2023-04-06 12:08:24 -04:00
|
|
|
-- Set the tab width to 4 spaces
|
|
|
|
vim.cmd('set tabstop=4')
|
|
|
|
vim.cmd('set shiftwidth=4')
|
|
|
|
vim.cmd('set expandtab')
|
2023-04-07 19:59:09 -04:00
|
|
|
|
|
|
|
vim.o.hidden = true
|