start with v3.0 and merge in ptv3

This commit is contained in:
Paul Trowbridge 2024-03-13 14:04:45 -04:00
parent bb731ccbbb
commit becf28986a
3 changed files with 69 additions and 11 deletions

1
.gitignore vendored
View File

@ -6,5 +6,6 @@ syntax
coc-settings.json coc-settings.json
.luarc.json .luarc.json
lazy-lock.json lazy-lock.json
*.log
after after
**/.DS_Store **/.DS_Store

View File

@ -1,4 +1,5 @@
require "core" require "core"
vim.api.nvim_set_var('mapleader', ';')
pcall(require, 'custom') pcall(require, 'custom')
@ -14,6 +15,63 @@ dofile(vim.g.base46_cache .. "defaults")
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
require "plugins" require "plugins"
-- new from v3.0
vim.schedule(function() vim.schedule(function()
require "core.mappings" require "core.mappings"
end, 0) 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 = {
["<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, {})
-- 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 })
-- 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', '<leader>gd', ':Gitsigns diffthis<CR>', {noremap = true, silent = true})

View File

@ -16,11 +16,12 @@ local options = {
adaptive_size = false, adaptive_size = false,
side = "left", side = "left",
width = 30, width = 30,
preserve_window_proportions = true, preserve_window_proportions = true
-- hide_root_folder = true,
}, },
git = { git = {
enable = false, enable = true,
ignore = true, ignore = false,
}, },
filesystem_watchers = { filesystem_watchers = {
enable = true, enable = true,
@ -31,10 +32,8 @@ local options = {
}, },
}, },
renderer = { renderer = {
root_folder_label = false, highlight_git = true,
highlight_git = false,
highlight_opened_files = "none", highlight_opened_files = "none",
indent_markers = { indent_markers = {
enable = true, enable = true,
}, },
@ -44,16 +43,16 @@ local options = {
file = true, file = true,
folder = true, folder = true,
folder_arrow = true, folder_arrow = true,
git = false, git = true,
}, },
glyphs = { glyphs = {
default = "󰈚", default = "",
symlink = "", symlink = "",
folder = { folder = {
default = "", default = "",
empty = "", empty = "",
empty_open = "", empty_open = "",
open = "", open = "",
symlink = "", symlink = "",
symlink_open = "", symlink_open = "",