mirror of
https://github.com/mitchell/dotfiles.git
synced 2025-12-18 04:47:22 +00:00
Breakup Neovim config into Lua modules
This commit is contained in:
parent
3179a5b48d
commit
1517f56c86
11 changed files with 662 additions and 584 deletions
20
.config/nvim/lua/core/autocmds.lua
Normal file
20
.config/nvim/lua/core/autocmds.lua
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
-- lua/core/autocmds.lua
|
||||
|
||||
local augroup = vim.api.nvim_create_augroup
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
-- Fish filetype settings
|
||||
augroup("FishSettings", { clear = true })
|
||||
autocmd("FileType", {
|
||||
pattern = "fish",
|
||||
command = "setlocal tabstop=4",
|
||||
group = "FishSettings",
|
||||
})
|
||||
|
||||
-- Terminal settings
|
||||
augroup("TerminalSettings", { clear = true })
|
||||
autocmd("TermOpen", {
|
||||
pattern = "*",
|
||||
command = "setlocal nonumber norelativenumber",
|
||||
group = "TerminalSettings",
|
||||
})
|
||||
22
.config/nvim/lua/core/keymaps.lua
Normal file
22
.config/nvim/lua/core/keymaps.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
-- lua/core/keymaps.lua
|
||||
|
||||
local map = vim.keymap.set
|
||||
local map_opts_silent = { noremap = true, silent = true }
|
||||
|
||||
-- General Mappings
|
||||
map("i", "jj", "<Esc>", { noremap = true, silent = true, desc = "Escape Insert Mode" })
|
||||
map("t", "<Esc>", "<C-\\><C-n>", { noremap = true, silent = true, desc = "Escape Terminal Mode" })
|
||||
map("v", "//", function()
|
||||
vim.cmd("normal! y")
|
||||
local sel = vim.fn.getreg('"')
|
||||
local pattern = vim.fn.escape(sel, "/\\")
|
||||
vim.fn.setreg("/", "\\V" .. pattern)
|
||||
vim.cmd("normal! n")
|
||||
end, { noremap = true, silent = true, desc = "Search for Visual Selection" })
|
||||
|
||||
-- LSP Diagnostic Mappings
|
||||
local diag_opts = { silent = true }
|
||||
vim.keymap.set("n", "<leader>d", vim.diagnostic.open_float, diag_opts)
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, diag_opts)
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, diag_opts)
|
||||
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist, diag_opts)
|
||||
28
.config/nvim/lua/core/options.lua
Normal file
28
.config/nvim/lua/core/options.lua
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
-- lua/core/options.lua
|
||||
|
||||
vim.opt.guifont = "JetBrainsMono Nerd Font:h13"
|
||||
vim.opt.colorcolumn = "100"
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.showmatch = true
|
||||
vim.opt.number = true
|
||||
vim.opt.showmode = false
|
||||
vim.opt.background = "dark"
|
||||
vim.opt.wrap = false
|
||||
vim.opt.cmdheight = 1
|
||||
vim.opt.shortmess:append("c")
|
||||
vim.opt.termguicolors = true
|
||||
vim.opt.mouse = "a"
|
||||
vim.opt.mousemodel = "extend"
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.shiftwidth = 0
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.textwidth = 100
|
||||
vim.opt.hlsearch = true
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
|
||||
if vim.g.neovide then
|
||||
vim.g.neovide_scale_factor = 0.75
|
||||
vim.g.neovide_transparency = 0.7
|
||||
vim.g.neovide_cursor_vfx_mode = "sonicboom"
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue